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 / helloworld.hs
Created March 9, 2014 05:42
Start with haskell.
{-main = do
putStrLn "Qual é o seu primeiro nome?"
primeiroNome <- getLine
putStrLn "Qual é o seu segundo nome?"
segundoNome <- getLine
putStrLn ("Olá, " ++ primeiroNome ++ " " ++ segundoNome ++ "!")
-}
@skvggor
skvggor / user.behaviors.clj
Created March 4, 2014 04:16
Meu arquivo `user.behaviors` do LightTable IDE.
;; User behaviors
;; -----------------------------
;; Behaviors are stored as a set of diffs that are merged together
;; to create the final set of functionality that makes up Light Table. You can
;; modify these diffs to either add or subtract functionality.
;;
;; Behaviors are added to tags, objects with those tags then automatically gain
;; whatever logic the behavior imparts. To see a list of user-level behaviors,
;; start typing a word related to the functionality you want in between the square
;; brackets (e.g. "theme").
@skvggor
skvggor / query.sql
Last active January 4, 2016 16:29
Update "proto" to "production".
-- Update custom fields
UPDATE
`wp_postmeta`
SET
`meta_value` = REPLACE(`meta_value`, 'proto/', '')
WHERE
`post_id` > 0;
-- Update site URL
@skvggor
skvggor / sample.js
Created January 26, 2014 15:46
example
var Apps, Nevada;
Nevada = Nevada || {};
Nevada.apps = {
indexOf: function() {
if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function(searchElement) {
'use strict';
var k, len, n, t;
@skvggor
skvggor / bin2iso
Created January 24, 2014 15:53
Convert BIN to CUE to (finally) ISO file
echo FILE "$1" BINARY >> $1.cue
echo TRACK 01 MODE1/2352 >> $1.cue
echo INDEX 01 00:00:00 >> $1.cue
bchunk $1 $1.cue $1.iso
rm $1.cue
@skvggor
skvggor / revista.sh
Last active January 4, 2016 08:39
Cria o arquivo .PDF para a versão online da Revista Mauá e Região.
# Testado no ZSH apenas
mkdir JPG && 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 -resize 1060x1500 $i -bordercolor white -border 0 JPG/$i.jpg; done && cd JPG && for i in $(ls *.jpg); do convert -monitor -resize 1536x2067\! $i CONVERTIDO-$i.jpg; done && rm -rf ^*pdf.jpg.jpg && convert -monitor *.jpg revista-maua-e-regiao-ed.pdf
@skvggor
skvggor / Vagrantfile.rb
Last active January 4, 2016 02:58
Vagrant file
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu"
config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/raring/current/raring-server-cloudimg-i386-vagrant-disk1.box"
config.vm.synced_folder "/home/marcker/Copy/Vagrant/vagrant1", "/home/marcker/Copy/Vagrant/vagrant2"
config.vm.network :private_network, ip: "192.168.33.10"
end
@skvggor
skvggor / peso-ideal.py
Created January 11, 2014 02:12
Chris python 2 code
#!/usr/bin/python
# -*- coding: utf-8 -*-
print 'Cálculo do peso ideal.'
altura = input('Digite seu altura: ')
masculino = (altura ** 2) * (22.5)
feminino = (altura ** 2) * (21)
sexo = raw_input('Digite seu sexo: ')
if sexo == 'masculino':
@skvggor
skvggor / st3.sublime-settings
Created January 1, 2014 19:47
sublime text 3
{
"caret_style": "smooth",
"color_scheme": "Packages/Dayle Rees Color Schemes/LastNight.tmTheme",
"draw_white_space": "all",
"fold_buttons": false,
"font_face": "Envy Code R",
"font_options":
[
"subpixel_antialias"
],
@skvggor
skvggor / encrypt-decrypt
Last active January 22, 2020 17:35
encrypt-decrypt
encrypt:
tar cj FOLDER_OR_FILE | openssl enc -aes-256-cbc -e > FILE.tar.bz2.e
decrypt:
openssl aes-256-cbc -d -in FILE.tar.bz2.e -out FILE_DECRYPTED.tar.bz2