Skip to content

Instantly share code, notes, and snippets.

@yoeran
yoeran / renamer.js
Created August 1, 2017 10:31
Simple NodeJS script for batch renaming files using Regex
/**
* Usage:
* node renamer.js [files] "[regexMatcher]" "[regexReplace]"
*
* Example:
* node rename.js *.mp3 "(.*)-([0-9].*)\.mp3" "%1.mp3"
*
* Extra tip: Add an alias to your .bash_profile that allows you to use `rename` anywhere.
* alias rename="node PATH_TO_SCRIPT/renamer.js"
*/
@yoeran
yoeran / .gitconfig
Last active September 29, 2020 16:23
Setup scripts after a clean install
[user]
name = NAME
email = EMAIL
[alias]
undo = reset --soft HEAD^
# Not quite as common as an amend, but still common
# https://git-scm.com/docs/git-reset#git-reset-emgitresetemltmodegtltcommitgt
glog = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'

Keybase proof

I hereby claim:

  • I am yoeran on github.
  • I am yoeran (https://keybase.io/yoeran) on keybase.
  • I have a public key ASCRooJOuGSHk9TvrvUjpawesVGUGD6HXznleyV9mFXsSAo

To claim this, I am signing this object:

@yoeran
yoeran / .editorconfig
Last active August 29, 2015 14:00
Editorconfig
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org
root = true
[*]
# Change these settings to your own preference
indent_style = tab
indent_size = 2
@yoeran
yoeran / Gemfile
Last active December 22, 2015 14:08
My starter-Gemfile
source 'https://rubygems.org'
# Core
gem 'rails', '4.1.6'
# Database
gem 'pg'
# Frontend
gem 'sass-rails', github: 'rails/sass-rails'
@yoeran
yoeran / Web Audio Cue Tests
Last active December 19, 2015 16:29 — forked from mbarton/Web Audio Cue Tests
Little test to combine microphone input (for recording) with multi-channel playback. Multi-channel playback probably only works on Chrome 28+ or Chrome Canary
<head>
<title>Cue Test</title>
</head>
<body>
<button id="main">Start Main</button>
<button id="cue">Start Cue</button>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="cue-test.js"></script>
</body>

Contract Killer 3

Revised date: 07/11/2012

Between us [company name] and you [customer name]

Summary:

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.

@yoeran
yoeran / reporter.js
Last active December 16, 2015 22:39
Javascript error tracking module
/*
Package : nl.yoeran.reporter
Date : 03-05-2013
Author : Yoeran Luteijn <contact@yoeran.nl>
Description : Little script to track frontend errors. No external library needed.
Template : https://gist.github.com/4078993
*/
define(function(){
/*
Usage in CSS:
body[data-viewport="mobile"] etc..
*/
function set_responsive_class(viewportwidth){
/* Small phones */
if (viewportwidth <= 480) {
@yoeran
yoeran / .htaccess
Created April 19, 2013 16:18
My .htaccess file for use with CodeIgniter. Based on H5BP .htaccess
# ----------------------------------------------------------------------
# Better website experience for IE users
# ----------------------------------------------------------------------
# Force the latest IE version, in various cases when it may fall back to IE7 mode
# github.com/rails/rails/commit/123eb25#commitcomment-118920
# Use ChromeFrame if it's installed for a better experience for the poor IE folk
<IfModule mod_headers.c>
Header set X-UA-Compatible "IE=Edge,chrome=1"