Skip to content

Instantly share code, notes, and snippets.

View mcls's full-sized avatar
🏠
Working from home

Maarten Claes mcls

🏠
Working from home
View GitHub Profile
@mcls
mcls / gist:1263108
Created October 4, 2011 23:02
CSS Triangles test
/**
* CSS Triangles test
*/
body {
background-color: #C0DFEC;
}
.funky {
width: 0px;
@mcls
mcls / configure_ee.py
Created November 23, 2011 12:49
Expression Engine Configuratie (School)
#!/usr/bin/python
import os
import re
##
# Helper function for setting permissions
#
def chmod(permissions, path):
permissions = str(permissions)
@mcls
mcls / pre-commit
Created July 6, 2012 14:27
Regex blacklist for git diff in git pre-commit hook
#!/usr/bin/env python
from subprocess import *
import sys
import re
# Add Regex to blacklist here
blacklist = [
"\+[ ]+NSLog.+" # Prevent NSLog's from being added
]
@mcls
mcls / osx_setup.md
Last active October 9, 2023 08:23 — forked from jpantuso/osx_lion_rail_setup.md
Setup mac for ruby dev
@mcls
mcls / gist:3377571
Created August 17, 2012 09:55
Unicode Arrows / Trianges
# app/controllers/users/password_controller.rb
class Users::PasswordsController < Devise::PasswordsController
def resource_params
params.require(:user).permit(:email, :password, :password_confirmation)
end
private :resource_params
end
@mcls
mcls / rtmp_meta.rb
Created May 14, 2013 14:10
Quick hack to fetch duration of RTMP stream using rtmpdump v2.4.
require 'forwardable'
module RtmpMeta
class Parser
PATTERN = /duration\s+(?<duration>\d+\.?\d+)$/
attr_reader :raw_data
def initialize raw_data
@raw_data = raw_data
end
@mcls
mcls / syn.go
Created January 8, 2014 20:49
Searches for synonyms online
package main
import (
"os"
"strings"
"github.com/PuerkitoBio/goquery"
"github.com/codegangsta/cli"
)
func findSynonyms(query string) string {
@mcls
mcls / .gitconfig
Created February 17, 2014 15:34
Git aliases
[alias]
st = status -bs
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
b = branch -v
co = checkout
undo = reset --soft HEAD^
cm = commit -v
today = log --since=midnight --author='Maarten Claes' --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit

Keybase proof

I hereby claim:

  • I am mcls on github.
  • I am mcls (https://keybase.io/mcls) on keybase.
  • I have a public key whose fingerprint is D608 CAAE 524B 038A 4BB5 BD72 035B 4046 E70B 8644

To claim this, I am signing this object: