Skip to content

Instantly share code, notes, and snippets.

Making an impact

Mark McDonnell Integralist

Making an impact
View GitHub Profile
Integralist /
Last active Jun 7, 2020 — forked from andriykohut/
[Python profiling context management] #python #profiling #performance
import cProfile
import contextlib
import io
import pstats
import sys
import timeit
def prof(*restrictions, stdout=True, dump=None, sortby='cumulative'):
View example.rb
require 'rouge'
require 'method_source'
require 'pp'
class Dbg
def initialize(object, to:)
@object, @stream = object, to
Integralist / Faraday SSL example.rb
Last active Oct 13, 2015 — forked from mislav/gist:938183
Faraday SSL example
View Faraday SSL example.rb
connection ='') do |builder|
builder.request :url_encoded # for POST/PUT params
builder.adapter :net_http
# same as above, short form:
connection = ''
connection.get '/posts'
Integralist / Godofile.go
Last active Aug 29, 2015
Godo re-build task
View Godofile.go
// It's important to realise that you'll only ever want to `go build` or `go run` a single file
// This confused me originally
// I could understand why my task's `Context` didn't get passed the name of the changed file
// The problem was I was just hacking little scripts together
// In practice, you'll be working within a project directory and you'll have a single entry point file
package main
import . ""
Integralist / Makefile
Last active Sep 10, 2020 — forked from isaacs/Makefile
Example of a detailed Makefile
View Makefile
# Hello, and welcome to makefile basics.
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
# Once you're done here, go to
# to learn SOOOO much more.

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.


Integralist /
Last active Aug 29, 2015 — forked from jcleveley-zz/
Zsh tips

Path replacement

Moving from: /www/site1/media/css/main to /www/site2/media/css/main can be a pain, but not in zsh:

cd site1 site2
Integralist / ext.vim
Last active Feb 11, 2019 — forked from sjl/ext.vim
Some basic examples of executing external commands within Vim's COMMAND-LINE mode
View ext.vim
" run command
" no stdin
" output displayed in "Press enter to continue" style
" current buffer untouched
" run command
" pipe range of text to command on stdin
" output replaces the range in the current buffer
:RANGE!grep foo
Integralist / curry.js
Last active Aug 29, 2015 — forked from unscriptable/curry.js
Curry implementation in Node
View curry.js
module.exports = curry;
function curry (f) {
var arity = f.length;
var params = [];
var end = createEnd(f, arity);
return createCurried(params, arity, end);
function createEnd (f, arity) {
Integralist / duck typing rspec.rb
Last active Aug 29, 2015 — forked from cupakromer/gist:974c6fb9d0d6de3c2a6e
Test "Duck Typing" using RSpec 3's `instance_double`
View duck typing rspec.rb
class Calculator
def reduce(operator)
fail "You shouldn't be calling this directly!"
def uses_a_duck_type(calculation)
You can’t perform that action at this time.