Skip to content

Instantly share code, notes, and snippets.

View skvggor's full-sized avatar
🇯🇲
Peace && Love.

Marcos skvggor

🇯🇲
Peace && Love.
View GitHub Profile
var itens = [
'apple',
'grape',
'orange'
];
itens
.join(',')
.replace(/(\w+(?!=\,))/g, '<li>\$1<\li>')
.split(',');
@metodologia
metodologia / gist:5518660
Last active December 17, 2015 00:09
Microdados com R - Código 2
# limpar memória do R
rm(list=ls(all=TRUE))
# indicar diretório de trabalho
setwd('~/Documents/R-workspace/2013 tutorial microdados')
# mostrar até 8 casas decimais
options("scipen" = 8)
# listar arquivos do diretório de trabalho
dir()
# ----------------------------------------------
# informações a serem retiradas da PNAD 2011
@kjunichi
kjunichi / gist:4133764
Created November 23, 2012 02:28
brew upgrade opencv
==> Upgrading opencv
Unsatisfied dependency: numpy
Homebrew does not provide Python dependencies; install with:
pip install numpy
brew remove opencv
/usr/local/share/python/pip install numpy
brew install tbb
brew install qt
@pbroschwitz
pbroschwitz / supplant.js
Created October 15, 2012 07:58
supplant - Crockford
/**
* supplant() does variable substitution on the string. It scans through the string looking for
* expressions enclosed in { } braces. If an expression is found, use it as a key on the object,
* and if the key has a string value or number value, it is substituted for the bracket expression
* and it repeats.
*
* Written by Douglas Crockford
* http://www.crockford.com/
*/
String.prototype.supplant = function (o) {
@peterssonjesper
peterssonjesper / grunt.js
Created October 11, 2012 19:44
Sample grunt configuration
module.exports = function(grunt) {
grunt.initConfig({
// Javascript minification
min : {
code : {
'src' : [
'public/js/file1.js',
'public/js/file2.js',
'public/js/file3.js'
],
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 16, 2025 22:55
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@itsjohncs
itsjohncs / gist:2914854
Created June 12, 2012 04:06
Terrible Code Snippet #2
def is_even(num):
"Returns true iff num is even."
i = 0
while i < num:
i += 2
return i == num
def get_even_numbers(a, b):
@liamcurry
liamcurry / gist:2597326
Created May 4, 2012 19:56
Vanilla JS vs jQuery

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@netojoaobatista
netojoaobatista / Date.prototype.diff.js
Created April 26, 2012 20:09
Returns the difference between two Date objects.
Object.defineProperty(Date.prototype,"diff",{
writable: false, configurable: false, enumerable: true,
/**
* Returns the difference between two Date objects.
* @param {Date} The date to compare to.
* @return {Object}
* @throws {TypeError}
*/
value: function(date) {