Skip to content

Instantly share code, notes, and snippets.

View dfischer's full-sized avatar

0x44 0x46 dfischer

View GitHub Profile
# 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'
@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
import ApolloClient, { createNetworkInterface } from 'apollo-client';
const networkInterface = createNetworkInterface('/graphql');
networkInterface.use({
applyMiddleWare(req, next) => {
if (!req.options.header) {
req.options.header = {}; // Create the header object if needed.
}
req.options.header.authorization = localStorage.getItem('token') ? localStorage.getItem('token') : null;
@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"
@thinkerbot
thinkerbot / sign_requests_with_instance_profile_for_aws_es.rb
Created August 4, 2016 20:03
Sign requests to get access to a role-controlled AWS elasticsearch
require 'aws-sdk'
require 'faraday_middleware'
require 'faraday_middleware/aws_signers_v4'
require 'pp'
conn = Faraday.new(url: 'http://ENDPOINT') do |faraday|
faraday.request :aws_signers_v4,
credentials: Aws::InstanceProfileCredentials.new.credentials,
service_name: 'es',
region: 'REGION'
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...');
@csswizardry
csswizardry / email.md
Last active September 5, 2018 14:31
I frequently get asked about over-abstracted CSS, and ‘can CSS be too modular’, so I thought I’d publish this anonymised email I received, along with my reply.
@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
@monsonite
monsonite / SIMPL_430ASM_5
Created May 24, 2017 07:05
A Tiny Forth-Like interactive language for MSP430
;-------------------------------------------------------------------------------
; SIMPL - a very small Forth Inspired Extensible Language
; Implementing the Initialisation, TextTead, TextEval and UART routines in MSP430 assembly language
;
; A Forth-Like Language in under 1024 bytes
; Ken Boak May 2017
; Loops, I/O, Strings and Delays added
; This version 888 bytes
; SIMPL_430ASM_5
@dfischer
dfischer / SIMPL_MSP430ASM_6
Created February 6, 2021 09:19 — forked from monsonite/SIMPL_MSP430ASM_6
SIMPL - a tiny forth like language implemented in under 900 bytes of MSP430 Assembly Language (For MSP430G2553 Launchpad)
;-------------------------------------------------------------------------------
; SIMPL - a very small Forth Inspired Extensible Language
; Implementing the Initialisation, TextTead, TextEval and UART routines in MSP430 assembly language
;
; A Forth-Like Language in under 1024 bytes
; Ken Boak May 22nd/23rd 2017
; Loops, I/O, Strings and Delays added
; This version 888 bytes
; SIMPL_430ASM_6