Skip to content

Instantly share code, notes, and snippets.

View alaz's full-sized avatar

Alexander Azarov alaz

View GitHub Profile
@milessabin
milessabin / gist:6240282
Last active December 21, 2015 03:09
Module with a single function entry point and some associated types which aren't always needed. Useful idiom or too cute?
scala> :paste
// Entering paste mode (ctrl-D to finish)
// tag is a module which can be imported from, but also, thanks to its apply method and Scala's
// syntactic sugar, a function-like value which can be invoked directly.
object tag {
def apply[U] = new Tagger[U]
trait Tagged[U]
type @@[+T, U] = T with Tagged[U]
@leon
leon / Grunt.scala
Last active September 3, 2016 02:23
Playframework 2.2 Grunt Runner
import sbt._
import Keys._
import java.net._
import java.io.File
import play.PlayRunHook
/*
Grunt runner should be in project directory to be picked up by sbt
*/
object Grunt {
@DeaconDesperado
DeaconDesperado / Bloom.scala
Last active January 30, 2017 10:18
Trivial bloom filter implementation in Scala.
class BloomSet[A] private (val size: Int, val k: Int,private val contents: Vector[Boolean]){
val width = contents.length
def this(width: Int, k: Int) = this(0, k, BloomSet.alloc(width))
def contains(e:Any) = {
(0 to k).foldLeft(true) { (acc,i) =>
acc && contents(hash(e,i,width))
}
@jmoy
jmoy / thin-film.ipynb
Last active November 18, 2018 19:51
Why soap bubbles are colorful and windowpanes are not
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@anderssvendal
anderssvendal / Procfile
Created May 3, 2012 13:44
Foreman nginx, php, mysql setup
web: /usr/local/sbin/nginx -p `pwd`/tmp/nginx/ -c ../../nginx.conf
fastcgi: /usr/local/sbin/php-fpm
db: /usr/local/bin/mysqld
@lenage
lenage / dnscrypt.csv
Created July 30, 2016 04:29
DNScrypt server list
We can make this file beautiful and searchable if this error is corrected: It looks like row 5 should actually have 14 columns, instead of 6. in line 4.
Name,Full name,Description,Location,Coordinates,URL,Version,DNSSEC validation,No logs,Namecoin,Resolver address,Provider name,Provider public key,Provider public key TXT record
4armed,4ARMED,DNSCrypt Server provided by www.4armed.com,France,,https://www.4armed.com,1,yes,yes,no,51.254.115.48:443,2.dnscrypt-cert.dnscrypt.4armed.io,FD3E:5887:63EA:17A9:1AF8:4325:DE82:1507:6ED0:01AB:2F9E:55DE:689B:F491:4D8E:526E,
cisco,Cisco OpenDNS,Remove your DNS blind spot,Anycast,,https://www.opendns.com,1,no,no,no,208.67.220.220:443,2.dnscrypt-cert.opendns.com,B735:1140:206F:225D:3E2B:D822:D7FD:691E:A1C3:3CC8:D666:8D0C:BE04:BFAB:CA43:FB79,
cisco-familyshield,Cisco OpenDNS with FamilyShield,Blocks web sites not suitable for children,Anycast,,https://www.opendns.com/home-internet-security/parental-controls/,1,no,no,no,208.67.220.123:443,2.dnscrypt-cert.opendns.com,B735:1140:206F:225D:3E2B:D822:D7FD:691E:A1C3:3CC8:D666:8D0C:BE04:BFAB:CA43:FB79,
cisco-ipv6,Cisco OpenDNS over IPv6,Cisco OpenDNS IPv6 sandbox,Anycast,,https://www.op
@voter101
voter101 / Gulpfile.js
Last active November 29, 2021 01:17
Gulpfile for Rails application with replaced Sprockets with Gulp
'use strict'
var gulp, sass, babelify, browserify, watchify, source, util;
gulp = require('gulp');
sass = require('gulp-sass');
babelify = require('babelify')
browserify = require('browserify');
watchify = require('watchify');
source = require('vinyl-source-stream');
@tispratik
tispratik / override_cache_key.rb
Last active February 13, 2022 08:50
Override cache key and touch methods in active record when we cannot update the last modified / updated at column in database. We keep track of the changes in memcache.
module CacheKeyMonkeyPatch
module ActiveRecord
module Integration
# Returns a cache key that can be used to identify this record.
#
# ==== Examples
#
# Product.new.cache_key # => "products/new"
# Product.find(5).cache_key # => "products/5" (updated_at / last_modified_time not available)

Code of Conduct

Communication

Times
  • All times will be communicated in a way that is unambiguous. This communication may be a local time, with a UTC offset specified.

For example: