Skip to content

Instantly share code, notes, and snippets.

seyhunak /
Last active Aug 29, 2015
Rails 4 - Sunspot - Solr - Tomcat


Install OpenJDK

sudo apt-get -y install openjdk-7-jdk
sudo mkdir /usr/java
sudo ln -s /usr/lib/jvm/java-7-openjdk-amd64 /usr/java/default

Install Tomcat

Krishna / gist:99829
Created Apr 22, 2009
vardump for Lua (modified from Lua Gems)
View gist:99829
-- vardump
-- original verstion by Tobias Sulzenbruck and Christoph Beckmann
-- source: Lua Gems, page 29
-- modifications: Krishna Kotecha
value - the value to dump
jastkand / ability.rb
Created Sep 22, 2012 — forked from watson/ability.rb
Active Admin CanCan integration with shared front/backend User model and multi-level autherization
View ability.rb
# app/models/ability.rb
# All front end users are authorized using this class
class Ability
include CanCan::Ability
def initialize(user)
user ||=
case user.role
when "admin"
View collatz.clj
(ns collatz.core)
(defn collatz
"Given n, it returns n/2 if it's even or n*3+1 if it's odd."
(if (even? n)
(/ n 2)
(+ (* 3 n) 1)))
(declare count-steps-of-collatz)
View clappr-with-playlist.html
<!DOCTYPE html>
<meta charset="utf-8">
<script src=""></script>
<div id="player"></div>
adnan-i / angular-timeout.html
Last active Mar 16, 2017 — forked from orjan/angular-timeout.html
Workaround for $httpProvider.defaults As discussed here, it is not possible to set default timeout in $httpProvider. This gist offers a workaround.
View angular-timeout.html
<!doctype html>
<html ng-app="myApp">
<script src=""></script>
<div ng-controller="TodoCtrl">
<button ng-click="beQuickOrBeDead()">Fetch with 100ms timeout</button>
<button ng-click="neverEndingStory()">Fetch with default timeout</button>


This benchmark evaluates the different presets options offered by x264, using medium as reference, and providing size and time differences (relative and not).

##benchmark Tests run with latest x264 (12139) and FFmpeg, configured to run with threading enabled. The slower and veryslow presets have been modified to keep the number of refs constant and compatible with most decoders. All results represent an average over 10 runs computed by perf.



This table shows the current implementation status of several multimedia fomats by popular tools and browsers. All tests were run with the latest available version, or git HEAD for open source software.

Symbols mean

  • fully supported
  • unsupported
  • 💭 work in progress
  • 1️⃣️ see notes
codification /
Last active Apr 29, 2019
Graphite client in python
import time
import socket
def collect_metric(name, value, timestamp):
sock = socket.socket()
sock.connect( ("localhost", 2003) )
sock.send("%s %d %d\n" % (name, value, timestamp))
def now():
return int(time.time())
View car_simulator_physics.txt