Skip to content

Instantly share code, notes, and snippets.

View semikolon's full-sized avatar

Fredrik Bränström semikolon

View GitHub Profile
@Panmind
Panmind / application_helper.rb
Created May 28, 2010 13:10
Zendesk dropbox and remote authentication plugin for Rails -- obsoleted by http://github.com/Panmind/zendesk
### This gist is obsoleted by the full plugin release:
### http://github.com/Panmind/zendesk - check it out :-)
module ApplicationHelper
include PM::Zendesk::Helpers
# .... more helpers ....
end
@rosskevin
rosskevin / Rakefile
Last active October 28, 2015 10:41
Rakefile - less to sass a.k.a. less2sass or less2scss
# less to scss based on http://stackoverflow.com/a/19167099/2363935
namespace :convert do
task :less_to_scss do
source_glob = "assets/less/*.less"
dest_dir = "converted"
rm_r dest_dir rescue nil
mkdir_p(dest_dir)
@rooreynolds
rooreynolds / voltmeter_things.ino
Last active December 29, 2015 18:49
Things-completed-today-meter
const int voltPin = 4;
const int maxVoltAdjust = 230; // analog out is max 255, but for my voltmeter 230 == 100%
void setup() {
pinMode(voltPin, OUTPUT);
Serial.begin(19200);
}
String inData;
@tdg5
tdg5 / mocha_calls_through.rb
Last active January 11, 2016 15:43
Mocha Expectation#calls_through
module Concerns
module Mocha
module CallsThrough
def calls_through
method_name = @method_matcher.expected_method_name
@mock.instance_variable_get(:@receiver)
@original_method = @mock.instance_variable_get(:@mockery).stubba.stubba_methods.find do |mockery|
mockery.method == method_name
end.instance_variable_get(:@original_method)
self
@olizilla
olizilla / meteor-dump.sh
Last active May 29, 2016 02:18
Dump a mongo db from a live meteor app to a local dump dir.
#!/bin/bash
# __
# _____ ____ _/ |_ ____ ____ _______
# / \ _/ __ \ \ __\_/ __ \ / _ \ \_ __ \
# | Y Y \\ ___/ | | \ ___/ ( <_> ) | | \/
# |__|_| / \___ > |__| \___ > \____/ |__|
# \/ \/ \/
#
# .___
# __| _/ __ __ _____ ______
@kevit
kevit / gist:4986610
Created February 19, 2013 14:58
Safari Reading list to Pocket import script
#!/bin/sh
#http://getpocket.com/import/instapaper
set -x
cat >> /tmp/import.html << "EOF"
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Instapaper: Export</title>
</head>
#
#= dump database to yaml for fixtures
#
# originated by elm200 <http://d.hatena.ne.jp/elm200/20070928/1190947947>
#
#== install
#
# move this file to RAILS_ROOT/lib/tasks/extract_fixtures.rake
#
namespace :db do
@jgoodall
jgoodall / things.sh
Created November 12, 2012 18:33
shell script to print things tasks to the screen (geektool)
#!/bin/bash
# useful for [geektool](http://projects.tynsoe.org/en/geektool/)
# jg: made lib_dir generic
# Title: Things Extract Script for GeekTool
# Author: Alex Wasserman
# Description: Extracts the currents items from Things database, stores in a temp file. Outputs tmp file if Things DB is locked in use.
# Things SQL Library
export SQL_LIBRARY="ThingsLibrary.db"
@kenyee
kenyee / gist:6307258
Last active December 17, 2022 10:38
How to add Node.js npms to your Meteor.js project.
Make a subdirectory named packages/mynpms in your project.
Add a package.js that looks something like this:
Package.describe({
summary: "Custom app NPM dependencies"
});
Npm.depends({
nconf: '0.6.7',
feedparser: '0.16.1'
# 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