Skip to content

Instantly share code, notes, and snippets.

View makefunstuff's full-sized avatar
😇
Why?

Iurii Plugatariov makefunstuff

😇
Why?
View GitHub Profile
@makefunstuff
makefunstuff / gist:6cd5b280b4290d948ecb
Last active August 29, 2015 14:01
naive example of using celluloid
require 'celluloid'
require 'open-uri'
require 'digest/sha1'
URL_LIST = %w{http://yandex.ru http://bing.com}
class UrlChecksumGen
include Celluloid
attr_reader :digest

-----BEGIN PGP MESSAGE----- Version: GnuPG v1

owFdkntQVFUcxxfwwWak0MQMiAZXY0w2Ovfecx+LZYBohloIKrOgLufccy57QXbh 7rKASmQlDpImOIkzjiYjyEQvTXFCU1HBeFSGktHT1IbRRpgickoLutds0s5f5/H5 fc/3e35nW0iQJTDgx1cbJ8nehvqAnuvYktG3v24dgz2kjElYxyhrNOr2mTM3KqBM ApNPyzDy0njNE+32EBqf542+y9gYP9W9msdtUCAexrMsU24zebNa1dy5VC/UNVOM IVThKVFUWRQ4gSVQkGSKRQwplCESAOZliUcQsYamy+P13Xctc0fTqRFjd77BJwkg 2eSTYJLJF985oCKrCIYqx2NIAJFYQO2KSFkJqBzhADBBL9XvZvKW5HtNrwVUz19D nbrHcyex4tPMYxYCEUJeBpLhBnldRgG2AztRRRYQxLISwUQgdowxoARCFUJABY7j

#!/bin/bash
# Converts an image in a multi-resolution favicon
# Requires Imagemagick
if [[ "$#" != "2" ]]; then
echo "Usage: $0 input.png output.ico" >&2
exit 1
fi
input="$1"
from re import findall
array = [10, 2, 14, 7, 8, 12, 15, 11, 0, 4, 1, 13, 3, 9, 6]
def phase_5():
a, b = map(lambda x: int(x), findall("\d+", raw_input()))
a &= 0xf
if a != 0xf:
require 'optparse'
# options hash to store parsed results
options = {}
# initialize option parser
OptionParser.new do |opts|
# provide banner with basic usage example
opts.banner = "USAGE do awesome stuff"
# our rule to parse
opts.on("-m", "--magick", "This stores our magick value") do |v|
class ActionDispatch::Routing::Mapper
def draw(routes_name)
instance_eval(File.read(
Rails.root.join("config/routes/#{routes_name}.rb")
))
end
end
// bootstrap example
.row
.col-md-12
.col-md-4
%button.btn.btn-default.btn-lg
// semantic ui example
.row
.twelwe.wide.colum
var Player = require('player')
player = new Player(process.argv[2]);
player.play();
gulp.task('browser-sync', function() {
browserSync({
open: false,
server: {
baseDir: './dist',
middleware: [historyApiFallback]
}
});
});
// Returns a correction value for the given breakpoint
// to prevent media query overlapping.
//
// Relies on the global variable $slicer-anti-overlap-corrections
// that should contain a list of allowed correction values.
//
// Returns either only positive or only negative value.
//
// anti-overlap-correction($bp, $positive: true)
// - $bp : a breakpoint, e. g. 800px or 20em