type: PIN
Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys
type: PIN
Consumer key: IQKbtAYlXLripLGPWd0HUA
| eval=eval=eval='eval$s=%q(eval(%w(puts((%q(eval=ev | |
| al=eval=^Z^##^_/#{eval@eval@if@eval)+?@*10+%(.size | |
| >#{(s=%(eval$s=%q(#$s)#)).size-1}}}#LMNOPQRS_##thx | |
| .flagitious!## )+?@*12+%(TUVW XY/.i@rescue## | |
| /_3141592653 589793+)+?@* 16+%(+271828 | |
| 182845904; _987654321 0;;eval)+? | |
| @*18+%("x =((#{s.s um}-eval. | |
| _sum)%256 ).chr; ;eval)+?@ | |
| *12+%(.s can(//){ a=$`+x+$ | |
| ^_a.unpa ck (^ H*^)[0]. |
| name: Tests | |
| on: | |
| pull_request: | |
| branches: | |
| - '*' | |
| push: | |
| branches: | |
| - master | |
| jobs: |
This gist applies the theory from Ilya Grigorik's Script-injected "async scripts" considered harmful on the default Universal Analytics snippet. TLDR place this above the CSS in the <head> of your document
<!-- Google Analytics Part 1: Creates window.ga, sets account, and queues pageview-->
<script>
!function(n,t){n.GoogleAnalyticsObject=t,n[t]=n[t]||function(){(n[t].q=n[t].q||[]).push(arguments)},n[t].l=1*new Date}(window,"ga");
ga('create', 'UA-XXXX-Y', 'auto'); // REPLACE UA-XXXX-Y w/ YOUR ACCOUNT
ga('send', 'pageview');| # Okasaki style Functional Red Black Tree | |
| # https://www.cs.tufts.edu/comp/150FP/archive/chris-okasaki/redblack99.pdf | |
| # | |
| # leaves and root are black | |
| # BST | |
| # No red node has a red child | |
| # Every path from the root to a leaf has the same number of black nodes | |
| module RBTree | |
| class Leaf |
| --- | |
| include: | |
| - "app/**/*.rb" | |
| - "config/**/*.rb" | |
| - "lib/**/*.rb" | |
| exclude: | |
| - spec/**/* | |
| - vendor/**/* | |
| - ".bundle/**/*" | |
| require: |
| module Clsx | |
| def clsx(*args) | |
| process_args = args.map do |arg| | |
| if arg.is_a?(Array) | |
| clsx(*arg) | |
| elsif arg.is_a?(Hash) | |
| arg.map do |key, value| | |
| key if value | |
| end | |
| else |
These instructions set up a way to publish tweets to Twitter's OAuth2 API from a Ruby on Rails app.
Set up a twitter account via the Twitter account setup instructions here: https://github.com/jkotchoff/twitter_oauth2#twitter-account-setup
Add the twitter_oauth2 gem and something to issue HTTP requests (like Typhoeus) to your Gemfile:
gem 'twitter_oauth2'
gem 'typhoeus'No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.
gpg --list-secret-keys and look for sec, use the key ID for the next stepgit to use GPG -- replace the key with the one from gpg --list-secret-keys| # @see https://docs.aws.amazon.com/ja_jp/AmazonCloudFront/latest/DeveloperGuide/LocationsOfEdgeServers.html | |
| # @see https://morizyun.github.io/ruby/rails-controller-get-ip.html | |
| # @see https://dev.classmethod.jp/cloud/aws/get-ec2-public-ip-range-by-powershell/ | |
| # @see https://github.com/rails/rails/blob/c81af6a/actionpack/lib/action_dispatch/middleware/remote_ip.rb#L112-L150 | |
| Rails.application.configure do | |
| ip_ranges_res = Faraday.get('https://ip-ranges.amazonaws.com/ip-ranges.json') | |
| ip_ranges = JSON.parse(ip_ranges_res.body) | |
| cloudfront_ips = ip_ranges['prefixes'].select { |v| v['service'] == 'CLOUDFRONT' }.map { |v| IPAddr.new(v['ip_prefix']) } + | |
| ip_ranges['ipv6_prefixes'].select { |v| v['service'] == 'CLOUDFRONT' }.map { |v| IPAddr.new(v['ipv6_prefix']) } |