Skip to content

Instantly share code, notes, and snippets.

View mariusbutuc's full-sized avatar
🌏

Marius Butuc mariusbutuc

🌏
  • Toronto, ON
  • 17:43 (UTC -04:00)
View GitHub Profile
@jasongoodwin
jasongoodwin / gist:fcbb575580406e6b0beb5496f8aaab63
Created November 29, 2017 15:49
Elixir Meetup - Slides - Jason Goodwin - Nov2017
---
# Functional Programming Paradigms In Elixir
- Objectives:
- Understand functional programming a bit better
- Categorize and understand approaches
- See which approaches fit which problems
- Map concepts and approaches from Scala/Haskell to elixir
---
@josevalim
josevalim / watcher.sh
Last active May 22, 2024 10:06
A 1LOC bash script for re-running tests whenever a lib/ or test/ file changes keeping the same VM instance
# You will need fswatch installed (available in homebrew and friends)
# The command below will run tests and wait until fswatch writes something.
# The --stale flag will only run stale entries, it requires Elixir v1.3.
fswatch lib/ test/ | mix test --stale --listen-on-stdin
@katz
katz / RecalculateSellectedCells.gs
Last active April 15, 2021 14:58
Google Apps Script to re-calculate selected cells in Sheets
/**
* @OnlyCurrentDoc Limits the script to only accessing the current spreadsheet.
*/
/**
* Adds a custom menu with items to show the sidebar and dialog.
*
* @param {Object} e The event parameter for a simple onOpen trigger.
*/
@staltz
staltz / introrx.md
Last active June 26, 2024 10:24
The introduction to Reactive Programming you've been missing
@zacstewart
zacstewart / classifier.py
Last active March 27, 2023 15:59
Document Classification with scikit-learn
import os
import numpy
from pandas import DataFrame
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.naive_bayes import MultinomialNB
from sklearn.pipeline import Pipeline
from sklearn.cross_validation import KFold
from sklearn.metrics import confusion_matrix, f1_score
NEWLINE = '\n'
@ghalimi
ghalimi / NPER.js
Created January 23, 2013 23:13
NPER Function
// Copyright (c) 2012 Sutoiku, Inc. (MIT License)
function NPER(rate, payment, present, future, type) {
// Initialize type
var type = (typeof type === 'undefined') ? 0 : type;
// Initialize future value
var future = (typeof future === 'undefined') ? 0 : future;
// Evaluate rate and periods (TODO: replace with secure expression evaluator)
@arax
arax / gist:4226541
Created December 6, 2012 17:56
VCR - ignore specific requests
VCR.configure do |c|
c.hook_into :webmock
c.cassette_library_dir = 'spec/cassettes'
c.default_cassette_options = { :record => :new_episodes }
## Ignore some requests based on the hosts involved.
c.ignore_hosts 'localhost', '8.8.8.8', 'our.local.test.server.org'
## Ignore some requests based on their properties.
# The block passed to c.ignore_request has to
@thedamon
thedamon / gist:4158016
Created November 27, 2012 23:48
1px by 1px square transparent png binary
<img width="1" height="1" title="" alt="" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABBJREFUeNpi+P//PwNAgAEACPwC/tuiTRYAAAAASUVORK5CYII=" />
@imkevinxu
imkevinxu / .gitconfig
Created November 5, 2012 09:42
`git random` alias that will commit a random commit message from http://whatthecommit.com/
[alias]
random = !"git add -A; git commit -am \"$(echo $(curl -s http://whatthecommit.com/index.txt)\" (http://whatthecommit.com)\")\"; git pull --rebase; git push"
@ryanb
ryanb / chef_solo_bootstrap.sh
Created April 5, 2012 04:35
Bootstrap Chef Solo
#!/usr/bin/env bash
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline5-dev libyaml-dev
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz
tar -xvzf ruby-1.9.3-p125.tar.gz
cd ruby-1.9.3-p125/
./configure --prefix=/usr/local
make
make install