Skip to content

Instantly share code, notes, and snippets.

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

Marcos skvggor

🇯🇲
Peace && Love.
View GitHub Profile
@skvggor
skvggor / converter.sh
Last active December 19, 2015 11:59
Cria o Jornal e a Revista no formato correto a partir de arquivos .pdf
# Jornal Mauá e Região
for i in $(ls *.pdf); do convert -monitor -crop 0x0+150+150 -gravity Center -density 300 -quality 90 -attenuate 40 -antialias -colorspace RGB -level 0%,100%,1.7 -crop -75-75 -bordercolor white -border 130x130 -resize 1060x1500 $i $i.jpg; done
# Quando o anúncio do jornal não possuir margem
for i in $(ls *.pdf); do convert -crop 0x0+100+100 -gravity Center -density 300 -quality 90 -attenuate 40 -antialias -colorspace RGB -level 0%,100%,1.7 -crop -0-0 -bordercolor white -border 130x130 -resize 1060x1500 $i $i.jpg; done
for i in $(ls *.jpg); do convert -monitor -resize 1536x2067 $i CONVERTIDO-$i.jpg; done
convert -monitor *.jpg documento.pdf
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 July 3, 2025 16:10
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
})