Skip to content

Instantly share code, notes, and snippets.

find . -type d -exec chmod 755 {} \; # Change directory permissions rwxr-xr-x
find . -type f -exec chmod 644 {} \; # Change file permissions rw-r--r--
diskutil unmountDisk /dev/disk2
sudo dd if=/Users/UserName/Downloads/Win10_XXXX_x64.iso of=/dev/disk2 bs=1m
diskutil eject /dev/disk2

screen capture image type

You can change the default file type for screen captures by using a terminal command. Every installation of Mac OS X includes the Terminal application in Applications > Utilities. Most major image formats are supported including PNG, PDF, GIF, TIFF, and JPG, we’ll go with JPG since that is a common type of web graphic:

defaults write com.apple.screencapture type jpg

Then you must kill the SystemUIServer for changes to take effect:

killall SystemUIServer

# to run, write ./backup_photos.sh
rsync -avE -delete ~/Pictures/@MobilePhotos/ "/Volumes/SAMSUNG_MAC/ALBUM/@MobilePhotos"
rsync -avE -delete ~/Movies/@MobileVideos/ "/Volumes/SAMSUNG_MAC/ALBUM/@MobileVideos"
rsync -avE -delete ~/Movies/360/ "/Volumes/SAMSUNG_MAC/ALBUM/360"
import random
palavras = ['ᆜᆛᆍᆏᚙ','ᆓ', '𧍌𤏨', 'ઋ']
while True:
print(palavras[random.randint(0, 3)]*random.randint(1, 10),end="")
@sulram
sulram / git.md
Last active August 29, 2015 14:27

get new remote branch

# fetch all
git fetch origin

# list all
git branch -v -a

# checkout and track new branch

git checkout -b test origin/test

# wordmove chmod bug
find path/to/dir/ -type f -exec chmod 664 {} + -o -type d -exec chmod 775 {} +
@sulram
sulram / .zshrc
Last active August 29, 2015 14:24
# Path to your oh-my-zsh installation.
export ZSH=/Users/marlus/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"
# Uncomment the following line to use case-sensitive completion.
@sulram
sulram / webpack.vue.js
Created July 2, 2015 20:52
EXPOSE WEBPACK + VUE MODULE
// EXPOSE WEBPACK + VUE MODULE
// http://webpack.github.io/docs/library-and-externals.html
// http://paulsalaets.com/posts/expose-node-module-as-global-variable/
// webpack.config.js
module.exports = {
entry: "./src/main.js",
output: {
path: "./build",
@sulram
sulram / chuva_osc_serial.pde
Created June 13, 2015 03:29
<desafiando a gravidade> chuva
import oscP5.*;
import netP5.*;
import processing.serial.*;
Serial myPort;
Serial myPort2;
int val;
OscP5 oscP5;