Skip to content

Instantly share code, notes, and snippets.

View gustavomdsantos's full-sized avatar
👨‍💻
Working as an IT manager

Gustavo Moraes gustavomdsantos

👨‍💻
Working as an IT manager
  • Universidade Federal de Goiás
  • Brasília, Distrito Federal
View GitHub Profile
@schacon
schacon / gist:942899
Created April 26, 2011 19:19
delete all remote branches that have already been merged into master
$ git branch -r --merged |
grep origin |
grep -v '>' |
grep -v master |
xargs -L1 |
awk '{split($0,a,"/"); print a[2]}' |
xargs git push origin --delete
@janmoesen
janmoesen / .bash_profile
Created August 19, 2011 06:01
Temporary .bash_profile
# ============== shell
# Case-insensitive globbing.
shopt -s nocaseglob;
# Do not overwrite files when redirecting using ">", ">&" or "<>".
# Note that you can still override this with ">|".
set -o noclobber;
# UTF-8 all the way.
export LC_ALL='en_GB.UTF-8';
@AndreasBriese
AndreasBriese / underscoreAddon.js
Created January 24, 2012 14:45
underscore addon -> sum, mean, median, nrange
// underscore addon with sum, mean, median and nrange function
// see details below
_.mixin({
// Return sum of the elements
sum : function(obj, iterator, context) {
if (!iterator && _.isEmpty(obj)) return 0;
var result = 0;
if (!iterator && _.isArray(obj)){
@camiloribeiro
camiloribeiro / triangle.feature
Created February 15, 2012 04:17
Simple cucumber example in Portuguese
#language: pt
Funcionalidade: Leitor de tipos de Triângulo
Para conhecer o tipo de um triângulo
Como um aluno da matemática
Eu quero informar os tamanhos do lado de um triângulo e saber qual o tipo do triângulo
NARRATIVA
Um triângulo com todos os lados iguais é chamado Equilátero
@BrockA
BrockA / waitForKeyElements.js
Created May 7, 2012 04:21
A utility function, for Greasemonkey scripts, that detects and handles AJAXed content.
/*--- waitForKeyElements(): A utility function, for Greasemonkey scripts,
that detects and handles AJAXed content.
Usage example:
waitForKeyElements (
"div.comments"
, commentCallbackFunction
);
@jayj
jayj / flexbox.less
Last active November 20, 2023 04:51
CSS3 Flexbox - LESS Mixins
// --------------------------------------------------
// Flexbox LESS mixins
// The spec: http://www.w3.org/TR/css3-flexbox
// --------------------------------------------------
// Flexbox display
// flex or inline-flex
.flex-display(@display: flex) {
display: ~"-webkit-@{display}";
display: ~"-ms-@{display}box"; // IE10 uses -ms-flexbox
@lordofthelake
lordofthelake / .gitignore
Created June 21, 2013 18:39
.gitignore for Maven, Intellij, Eclipse
# Eclipse
.classpath
.project
.settings/
# Intellij
.idea/
*.iml
*.iws
@seanbuscay
seanbuscay / git_create_orphan.sh
Created June 27, 2013 15:26
Create an orphan branch in a repo.
cd repository
git checkout --orphan orphan_name
git rm -rf .
rm '.gitignore'
echo "#Title of Readme" > README.md
git add README.md
git commit -a -m "Initial Commit"
git push origin orphan_name
@deshack
deshack / roboto-condensed.css
Last active September 9, 2023 08:24
Add Roboto Condensed to your project with @font-face CSS rule. See http://deshack.net/use-roboto-condensed-font-face-css-rule/ for a complete and detailed tutorial.
/**
* Include Roboto Condensed font in your project
*
* Download Roboto Condensed ttf files from Google Fonts and place it in the same directory of this CSS file
* You can then use this font in your project by setting
* font-face: "Roboto Condensed", Helvetica, Arial, sans-serif;
*
* @author Mattia Migliorini (deshack)
* @license MIT
*/
@kirilloid
kirilloid / jsPrimitiveCompare
Last active August 27, 2022 04:59
JavaScript primitive (non-strict) comparison table
// italics for objects
(function (values) {
function toString(x) {
var v = x;
v = (v || v === "") ? JSON.stringify(v) : String(v);
if (typeof x === 'object') v = v.italics();
return v;
}
function describe (i,j) {
var v1 = values[i],