Skip to content

Instantly share code, notes, and snippets.

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

André Mendes dremendes

🏠
Working from home
View GitHub Profile
@EduardoMRB
EduardoMRB / post-receive
Last active August 29, 2015 14:22
PHP deploy skeleton
#!/bin/bash
set -e
# file: hooks/post-receive inside git repository.
$WORK_DIR=path/to/work/directory
$GIT_DIR=path/to/git/directory
git --work-tree=$WORK_DIR --git-dir=$GIT_DIR checkout -f
[
{ "keys": ["ctrl+t"], "command": "phpunit_run_tests" },
{ "keys": ["ctrl+shift+."], "command": "phpunit_run_all_tests" },
{ "keys": ["ctrl+shift+,"], "command": "phpunit_open_class_being_tested" },
{ "keys": ["ctrl+shift+1"], "command": "run_macro_file", "args": {"file": "res://Packages/User/var_dump.sublime-macro"} },
{ "keys": ["ctrl+shift+2"], "command": "run_macro_file", "args": {"file": "res://Packages/User/ini_set.sublime-macro"} },
{ "keys": ["ctrl+shift+3"], "command": "run_macro_file", "args": {"file": "res://Packages/User/importante.sublime-macro"} },
{ "keys": ["ctrl+shift+["], "command": "bh_key", "args": { "no_outside_adj": true, "lines" : true, "plugin": { "type": ["__all__"], "command": "bh_modules.bracketselect", "args": {"select": "left"} }}},
{ "keys": ["ctrl+shift+]"], "command": "bh_key", "args": { "no_outside_adj": true, "lines" : true, "plugin": { "type": ["__all__"], "command": "bh_modules.bracketselect", "args": {"select": "right"} }}},
{ "keys": [
@nk9
nk9 / largestFiles.py
Last active December 5, 2024 18:54
Python script to find the largest files in a git repository.
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Python script to find the largest files in a git repository.
# The general method is based on the script in this blog post:
# http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/
#
# The above script worked for me, but was very slow on my 11GB repository. This version has a bunch
# of changes to speed things up to a more reasonable time. It takes less than a minute on repos with 250K objects.
#
@dengshuan
dengshuan / ckedit.py
Last active January 29, 2020 20:31 — forked from mrjoes/ckedit.py
Apply ckeditor(WYSIWYG rich text editor) to flask-admin textarea
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext import admin
from wtforms import TextAreaField
from wtforms.widgets import TextArea
from flask.ext.admin.contrib.sqla import ModelView
app = Flask(__name__)
app.config['SECRET_KEY'] = '123456790'
@cassiocardoso
cassiocardoso / select-estados-br
Created February 12, 2014 23:31
Select com uma lista de todos os estados brasileiros.
<select name="estados-brasil">
<option value="AC">Acre</option>
<option value="AL">Alagoas</option>
<option value="AP">Amapá</option>
<option value="AM">Amazonas</option>
<option value="BA">Bahia</option>
<option value="CE">Ceará</option>
<option value="DF">Distrito Federal</option>
<option value="ES">Espírito Santo</option>
<option value="GO">Goiás</option>
@addyosmani
addyosmani / headless.md
Last active May 17, 2024 03:38
So, you want to run Chrome headless.

Update May 2017

Eric Bidelman has documented some of the common workflows possible with headless Chrome over in https://developers.google.com/web/updates/2017/04/headless-chrome.

Update

If you're looking at this in 2016 and beyond, I strongly recommend investigating real headless Chrome: https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md

Windows and Mac users might find using Justin Ribeiro's Docker setup useful here while full support for these platforms is being worked out.

@liamcurry
liamcurry / gist:2597326
Created May 4, 2012 19:56
Vanilla JS vs jQuery

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active April 14, 2025 11:07
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh