Skip to content

Instantly share code, notes, and snippets.

@Hanmac
Hanmac / gemtree.rb
Last active August 29, 2015 14:04
GemTree
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'optparse'
require 'ostruct'
# using list from graph gem
COLOR_SCHEME_MAX = {
accent: 8, blues: 9, brbg: 11, bugn: 9,
dark2: 8, gnbu: 9, greens: 9, greys: 9,
@hipertracker
hipertracker / gist:214210
Created October 20, 2009 12:05
NGinx -> TorqueBox
/etc/hosts:
127.0.0.1 myhost jboss_server
NGINX:
server {
listen myhost:80;
server_name myhost;
location / {
proxy_set_header X-Real-IP $remote_addr;
package com.dango_itimi.utils;
import haxe.rtti.Meta;
using com.dango_itimi.utils.MetaUtil;
class MetaField
{
public var name(default, null):String;
public var value(default, null):Array<Dynamic>;
public function new(name:String, value:Array<Dynamic>)
@momer
momer / explain_analyze.sql
Last active December 16, 2015 11:29
Super Fast Random Postgres Queries
--
-- Person's unoptimized query
--
QUERY PLAN
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Seq Scan on keyword_tracked_tweets (cost=0.06..484854.06 rows=50015 width=172) (actual time=16639.692..32543.957 rows=1 loops=1)
Filter: ((id)::double precision = trunc((random() * ($1)::double precision)))
InitPlan 2 (returns $1)
-> Result (cost=0.05..0.06 rows=1 width=0) (actual time=0.045..0.047 rows=1 loops=1)
@bkutil
bkutil / deploy.rb
Created December 4, 2011 22:22 — forked from andruby/deploy.rb
Start and Stop tasks for resque workers and resque scheduler with capistrano deploy hook (without God)
after "deploy:symlink", "deploy:restart_workers"
after "deploy:restart_workers", "deploy:restart_scheduler"
##
# Rake helper task.
# http://pastie.org/255489
# http://geminstallthat.wordpress.com/2008/01/27/rake-tasks-through-capistrano/
# http://ananelson.com/said/on/2007/12/30/remote-rake-tasks-with-capistrano/
def run_remote_rake(rake_cmd)
rake_args = ENV['RAKE_ARGS'].to_s.split(',')
@cybrox
cybrox / EmberChartComponent.js
Created June 5, 2014 12:39
Use Chart.js as a simple Ember.js component
/**
* This is a very simple example of an ember component to integrate
* nnick/chart.js in an ember.js application. Basically, it is simply
* using the components hook to create a ChartJS canvas element.
* Additionally, it supports an update property that allows you to
* let the chart re-rendet if your data or options change. Chart.js
* doesn't support updating its data so this will just create a new
* chart on the given canvas.
*
* Example usage in a handlebars template:
@phlbnks
phlbnks / Pure CSS Offsets
Last active July 23, 2019 08:01
CSS to add offsets to Pure grids http://purecss.io/
/*
Offsets from https://raw.githubusercontent.com/tilomitra/pure/d7f85e37abec3fdab14a541305ad05783159655c/src/grids/css/grids-offsets.css
Media queries from Pure v0.5.0
Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
https://github.com/yui/pure/blob/master/LICENSE.md
*/
@media screen and (min-width: 35.5em) {
.offset-sm-0 {
margin-left:0;
@seansawyer
seansawyer / vim-eclim-scala.md
Last active May 26, 2021 02:58
Vim + Eclim for Scala development

Vim + Eclim + Scala

WARNING! Do not install anything from update sites before installing Eclim! This is because Eclim determines available project natures (android, scala, etc) by trying to discover them at install time. If they are installed on a per-user basis, it won't find them. If you're installing Eclim for use with an existing Eclipse install

You're also better off not to install any plugins via your package manager. Eclim will give you the option to install plugins associated with each project nature from its install wizard.

Install Eclipse Luna. On Arch Linux, it's available in extra.

pacman -Sy eclipse

@rjmunro
rjmunro / .gitignore
Created June 21, 2013 13:54
gitignore for cordova cli projects
# Android
platforms/android/assets/www
platforms/android/bin/
platforms/android/gen/
platforms/android/res/xml/config.xml
# iOS
platforms/ios/build/
platforms/ios/CordovaLib/build/
platforms/ios/www