Skip to content

Instantly share code, notes, and snippets.

View salvianoo's full-sized avatar

Salviano Ludgério salvianoo

  • Fretebras
  • Brazil
View GitHub Profile
@steveklabnik
steveklabnik / ember_template.rb
Last active June 4, 2016 16:57
A template for making Ember apps with Rails.
run "sed --in-place '/turbolinks/d' Gemfile"
run "sed --in-place '/turbolinks/d' app/assets/javascripts/application.js"
run "sed --in-place '/coffee/d' Gemfile"
run "sed --in-place '/jbuilder/d' Gemfile"
run "sed --in-place 's/, \"data-turbolinks-track\" => true//' app/views/layouts/application.html.erb"
gem 'active_model_serializers'
@arturhoo
arturhoo / Easily Start and Stop EC2 Instances.md
Last active April 7, 2017 22:44
Ruby script to start and stop instances

How to use the script below

Requirements:

Two files are required: ~/.aws/config and a file containing instances ids, one per line, eg:

~/.aws/config

@rponte
rponte / deploy_app.sh
Last active September 23, 2017 17:11
Deploying a java app with shellscript through SSH - simple and efficient
#!/bin/bash
set -e # Exit script immediately on first error.
#set -x # Print commands and their arguments as they are executed.
# generate war file with ant or gradle or whatever you want
ant war
# upload the generated war file to the web server
scp -P 5122 target/war/MyApp-SNAPSHOT.war [email protected]:~/MyApp.war
@jbenet
jbenet / simple-git-branching-model.md
Last active May 3, 2025 18:07
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

class Class1():
pass
class Class2():
pass
class Class3(object):
pass
a = Class1()
var empty_list = function(selector) {
return selector(undefined, undefined, true);
};
var prepend = function(el, list) {
return function(selector) {
return selector(el, list, false);
};
};
var head = function(list) {
@balupton
balupton / LINUX.md
Last active May 27, 2022 10:22
New Machine Start Kit

Linux

Setup

# If inside vmware install vmware tools (these are just as good as the commercial ones)
sudo apt-get install open-vm-tools open-vm-tools-desktop

# Install git
sudo apt-get install git
@SlexAxton
SlexAxton / .zshrc
Last active March 24, 2025 17:35
My gif workflow
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else
@juanplopes
juanplopes / evaluator.py
Last active December 12, 2015 06:58
Pure python (no libs) recursive descendent parser for integer arithmetic expression.
import re, sys, json
TOKENS = {
'NUMBER': '[0-9]+',
'IDENTIFIER': '[a-zA-Z][a-zA-Z0-9]*',
'ADD': '\+',
'SUB': '-',
'POW': '\^',
'MUL': '\*',
'DIV': '/',
@jay3sh
jay3sh / gist:3083080
Created July 10, 2012 12:54
Watch script to compile Coffeescript, Jade and Less.css
/*
* Tested on node 0.6, Ubuntu
*/
#!/usr/bin/node
COLOR_GREEN="\033[01;32m"
COLOR_RED="\033[01;31m"
COLOR_YELLOW="\033[01;33m"
COLOR_BLUE="\033[01;34m"
COLOR_NORMAL="\033[00m"