Skip to content

Instantly share code, notes, and snippets.

@wonzbak
wonzbak / scopes.txt
Last active August 29, 2015 14:24 — forked from iambibhas/scopes.txt
Here is a list of scopes to use in Sublime Text 2 snippets -
ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
CoffeeScript: source.coffee
@wonzbak
wonzbak / fuzzy_file_finder.py
Created July 9, 2015 14:24
Fuzzy file finder
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
"""Find a file in a list in a fuzzy way.
"""
from __future__ import division
import os
import sys
import time
import re
var timer = function(name) {
var start = new Date();
return {
stop: function() {
var end = new Date();
var time = end.getTime() - start.getTime();
console.log('Timer:', name, 'finished in', time, 'ms');
}
}
};
@wonzbak
wonzbak / Mailer.php
Last active January 4, 2017 11:01
Mailer Symfony 2/3
<?php
class Mailer
{
/** @var \Swift_Mailer */
private $mailer;
/** @var \Swift_Transport_AbstractSmtpTransport */
private $transport;
@wonzbak
wonzbak / log.sh
Created February 15, 2017 10:56
colorized logs
#!/usr/bin/env bash
# colorize log thanks to Radu Cotescu (https://radu.cotescu.com/coloured-log-outputs/)
TAIL=`which tail`
AWK=`which awk`
if [[ -z $TAIL ]]; then
echo -e "Cannot find tail executable.\n"
exit 1
fi
@wonzbak
wonzbak / index.html
Created March 25, 2017 09:40
Html template
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Title</title>
<link rel="stylesheet" href="style.css">
<script src="script.js"></script>
</head>
<body>
<div id="container">
@wonzbak
wonzbak / release.sh
Last active June 5, 2017 14:30
bash script to prepare release with git
#!/bin/bash
CHANGELOG_FILENAME="CHANGELOG.rst"
LASTTAG=$(git tag| sort -V | tail -1)
echo "Last tag $LASTTAG"
TMPFILE=$(mktemp)
TODAY=$(date +%Y-%m-%d)
@wonzbak
wonzbak / mailer.php
Created March 16, 2018 16:19
Mailer High level class
<?php
namespace Mail;
/**
* Class Mailer
*
* Class to send email.
*
*/
@wonzbak
wonzbak / vimrc.minimal
Created March 6, 2017 15:13
Vim minimal config file
set shell=/bin/sh " fish friendly
"
" Base configuration from https://github.com/tpope/vim-sensible
"
if has('autocmd')
filetype plugin indent on
endif
if has('syntax') && !exists('g:syntax_on')
syntax enable
endif
<?php
/**
* Unaccent a string
*
* An example string like ÀØėÿᾜὨζὅБю will be translated to AOeyIOzoBY.
* More complete than :
*
* strtr(
* (string)$str,