Skip to content

Instantly share code, notes, and snippets.

View dfischer's full-sized avatar

0x44 0x46 dfischer

View GitHub Profile
@xn
xn / gist:1077093
Created July 12, 2011 00:12
patched ruby
curl https://raw.github.com/gist/1008945/7532898172cd9f03b4c0d0db145bc2440dcbb2f6/load.patch > /tmp/load.patch
rvm get head # always good to make sure you're up to date with RVM
rvm reload
rvm install ruby-1.9.2-p180 --patch /tmp/load.patch -n patched
rvm use ruby-1.9.2-p180-patched
if (Meteor.is_client) {
var userName = "PatelNachiket";
Template.hello.greeting = function () {
return "Fetch recent tweets from Twitter stream of user : " ;
};
Template.hello.events = {
'click #fetchButton' : function () {
console.log("Recent tweets from stream!");
$('#fetchButton').attr('disabled','true').val('loading...');
@zyphlar
zyphlar / googlevisualr-helper.rb
Created July 11, 2012 23:14
Helper and model methods for creating GoogleVisualr charts
# This is a Rails helper for generating a single chart for a column from a data set.
# blood_tests is the data set, and column_name is the column from the set to use.
# It calls generate_chart_row for each record, passing the column_name argument.
# It also does some stuff with vertical axis labels and chart options.
def generateChart(blood_tests, column_name)
data_table = GoogleVisualr::DataTable.new
@joshnuss
joshnuss / mnesia.exs
Last active March 9, 2024 00:32
Elixir example code for accessing mnesia databases
# define a record, first attribute is considered the key
defrecord User, email: "", first: "", last: ""
# encapsulates mnesia calls
defmodule Database do
def create_schema do
create_table User
end
def find(record, id) do
# A little Meteor CheatSheet about Iron-Router. (updated on a weekly basis)
# Check our Studio: https://gentlenode.com/
meteor add iron:router
meteor update iron:router
# Iron Router > Configuration
# A little Meteor CheatSheet about Iron-Router. (updated on a weekly basis)
# Check our Studio: https://gentlenode.com/
# Iron Router > Configuration
Router.configure
layoutTemplate: 'Main'
loadingTemplate: 'Loading'
@mokemokechicken
mokemokechicken / rcov_slack.sh
Last active August 31, 2016 01:42
SlackBot for rcov coverage report
COVERAGE_DIR=${COVERAGE_DIR:-coverage}
REPORT_NAME=${REPORT_NAME:-index.html}
author=$(git log --format='%an <%ae>' -1 $id_new | sed 's/\\/\\\\/g;s/\"/\\"/g')
message=$(git log --format=%s -1 $id_new | sed 's/\\/\\\\/g;s/\"/\\"/g')
latest="${COVERAGE_DIR}/${REPORT_NAME}"
[ -e "$COVERAGE_DIR" ] || mkdir "$COVERAGE_DIR"
cp "$1" "$latest"
@kachayev
kachayev / concurrency-in-go.md
Last active August 22, 2024 14:20
Channels Are Not Enough or Why Pipelining Is Not That Easy
@jish
jish / promise.js
Created October 28, 2014 22:35
An example "always" behavior for ES6 promises. This only works if you do not create / return intermediate promises.
// A thing I want to do
// This flow only involves **one** promise, for example an ajax call
// None of the subsequent `then` or `catch` calls, return new promises.
var explode = false;
var promise = new Promise(function(resolve, reject) {
if (explode) {