Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| # To check if this is up-to-date with the tax rates go to | |
| # http://www.expatax.nl/tax-rates-2016.php and see if there's anything | |
| # newer there. | |
| # | |
| # I make no guarantees that any of this is correct. I calculated this | |
| # at the time and have been updating it when new tax rates come along | |
| # because people keep finding this useful. | |
| # | |
| # There's also an interactive JS version of this created by | |
| # @stevermeister at |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| def msort[T](xs: List[T])(implicit ord: Ordering[T]): List[T] = { | |
| val n = xs.length / 2 | |
| if (n == 0) xs | |
| else { | |
| def merge(xs: List[T], ys: List[T]) : List[T] = { | |
| (xs, ys) match { | |
| case (Nil, ys) => ys | |
| case (xs, Nil) => xs | |
| case (x :: xs1, y :: ys1) => { | |
| if (ord.lt(x, y)) x :: merge(xs1, ys) |
| // C++11 lambdas aren't terribly useful at producing art. | |
| // Source below is valid C++11. VS2013 takes about a minute at it (Release config), | |
| // reaches almost 4GB of memory usage and then gives a | |
| // | |
| // 1>ConsoleApplication1.cpp(34): fatal error C1001: An internal error has occurred in the compiler. | |
| // 1> (compiler file 'msc1.cpp', line 1325) | |
| // 1> To work around this problem, try simplifying or changing the program near the locations listed above. | |
| // 1> Please choose the Technical Support command on the Visual C++ | |
| // 1> Help menu, or open the Technical Support help file for more information | |
| // 1> This error occurred in injected text: |
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');| --- | |
| include: | |
| - ".solargraph_definitions.rb" | |
| - "app/**/*.rb" | |
| - "config/**/*.rb" | |
| - "lib/**/*.rb" | |
| exclude: | |
| - test/**/* | |
| - vendor/**/* | |
| - ".bundle/**/*" |
| # 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 |
| 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'| # frozen_string_literal: true | |
| module Fingerprinting | |
| def full_fingerprint | |
| generate_fingerprint( | |
| ip_fingerprint, | |
| browser_fingerprint | |
| ) | |
| end |