Skip to content

Instantly share code, notes, and snippets.

View vitorfs's full-sized avatar

Vitor Freitas vitorfs

View GitHub Profile
  • diskutil list
  • diskutil unmountDisk /dev/disk2
  • dd if=/Users/you/Downloads/OpenELEC-RPi.arm-2.95.4.img of=/dev/disk2
@vitorfs
vitorfs / change-screenshot-folder.sh
Created July 4, 2016 08:35
How to change OS X default screenshot folder
defaults write com.apple.screencapture location ~/Desktop/Screenshots/
killall SystemUIServer
@vitorfs
vitorfs / referrer.js
Created July 7, 2016 14:26
Returns the URI of the page that linked to the current page.
var referrer_uri = document.referrer;
@vitorfs
vitorfs / social_networks.yml
Last active July 7, 2016 14:38
Jekyll Sample Data File
- name: GitHub
url: https://github.com/vitorfs
featured: true
- name: Twitter
url: https://twitter.com/vitorfs
featured: true
- name: LinkedIn
url: https://www.linkedin.com/in/vitorfs
@vitorfs
vitorfs / contact.html
Created July 7, 2016 14:38
Jekyll Sample Data File Usage
{% for network in site.data.social_networks %}
<div class="row">
<div class="three columns">
<strong>{{ network.name }}</strong>
</div>
<div class="nine columns">
<a href="{{ network.url }}" target="_blank">{{ network.url }}</a>
</div>
</div>
{% endfor %}
@vitorfs
vitorfs / gmail_search.txt
Created July 7, 2016 14:45
Search Gmail for unread emails without labels
is:unread has:nouserlabels
@vitorfs
vitorfs / grep.sh
Created July 7, 2016 14:57
Grep Command Example
cd /path/to/dir
grep -r "word" .
@vitorfs
vitorfs / 1-before.html
Last active July 10, 2016 12:41
jQuery Wrap Function
<h3>First</h3>
<h3>Second</h3>
<h3>Third</h3>
@vitorfs
vitorfs / recursion.py
Created July 10, 2016 12:52
Change Python Recursion Limit
import sys
# Get current limit
sys.getrecursionlimit() # Outputs 1000 (default)
# Set new limit
sys.setrecursionlimit(2000)
@vitorfs
vitorfs / change_password.html
Created August 4, 2016 09:08
Django Change Password View
<form method="post">
{% csrf_token %}
{{ form }}
<button type="submit">Save changes</button>
</form>