Skip to content

Instantly share code, notes, and snippets.

@dumaurier
dumaurier / dabblet.css
Created December 23, 2011 15:15
CSS Filters!
/**
* CSS Filters!
*/
figure:nth-of-type(1) img{
-webkit-filter:grayscale(1);
-webkit-transition:-webkit-filter 1s ease-in-out;
}
figure:nth-of-type(1) img:hover{
@saetia
saetia / gist:1525301
Created December 27, 2011 22:05
per user SSH

replace {{placeholders}} with your own values

On local machine

Generate a key

ssh-keygen -f {{identification}} -t rsa -q
ssh-add -K {{identification}}
@LBRapid
LBRapid / precompile.rake
Last active December 19, 2015 07:19
Precompile javascript assets in a rails engine
namespace :assets do
ROOT = Pathname.new(File.dirname(__FILE__))
LOGGER = Logger.new(STDOUT)
APP_ASSETS_DIR = ROOT.join("app/assets")
PUBLIC_ASSETS_DIR = ROOT.join("vendor/assets")
OUTPUT_DIR = ROOT.join("public")
desc 'Compile assets'
task :compile => :compile_js
@LBRapid
LBRapid / Guardfile
Created July 3, 2013 14:37
Guardfile guard-sprockets example
guard 'sprockets', :destination => 'public',
:asset_paths => ['app/assets/javascripts', 'vendor/assets/javascripts'],
:root_file => 'app/assets/javascripts/application.js', :minify => true do
watch(%r{^app/assets/javascripts/(.+)\.(js|js\.coffee)})
end
@SyntaxC4
SyntaxC4 / config.hdf
Last active December 28, 2015 04:48
Upstart script for hhVM on Ubuntu 13.04
Server {
SourceRoot = /var/www
}
# RSpec
require 'spec/expectations'
# Webrat
require 'webrat'
require 'test/unit/assertions'
World(Test::Unit::Assertions)
Webrat.configure do |config|
@gerard-kanters
gerard-kanters / server.ini
Last active September 18, 2016 12:17
HHVM server ini
;extension = /usr/lib64/php/modules/geoip.so
hhvm.pid_file = "/var/run/hhvm/hhvm.pid"
hhvm.server.port = 9000
hhvm.server.fix_path_info = true
hhvm.server.type = fastcgi
hhvm.server.enable_magic_quotes_gpc = false
hhvm.server.enable_keep_alive = true
hhvm.server.enable_ssl = true
hhvm.log.access_log_default_format = "%h %l %u %t \"%r\" %>s %b"
@adrienbrault
adrienbrault / gist:1401812
Created November 28, 2011 20:07
Install coffee script compiler on CentOS

You are going to install some things. Login in root or use sudo for most of the followings commands.

su -

First you need git.

yum install git
@saetia
saetia / parse.rb
Last active June 26, 2017 16:59
Parse MySQL dumps
ruby -e "$(curl -fsSkL https://gist.githubusercontent.com/saetia/2369908/raw/4bf9a6d36060582e69f02c314f66449971a7bb11/parse.rb)" /Users/Joel/site.db.121010.dump
ruby parse.rb site.120411.dump
@jstart
jstart / touchID
Last active July 28, 2017 17:58
Touch ID Example
LAContext *myContext = [[LAContext alloc] init];
NSError *authError = nil;
NSString *myLocalizedReasonString = @"Authenticate using your finger";
if ([myContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&authError]) {
[myContext evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics
localizedReason:myLocalizedReasonString
reply:^(BOOL success, NSError *error) {
if (success) {
NSLog(@"User is authenticated successfully");
} else {