Skip to content

Instantly share code, notes, and snippets.

View dotspencer's full-sized avatar

Spencer Smith dotspencer

View GitHub Profile
@oodavid
oodavid / README.md
Last active June 12, 2024 00:28 — forked from aronwoost/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@atenni
atenni / README.md
Last active July 5, 2024 12:58
How to permalink to a gist's raw file

Problem: When linking to the raw version of a gist, the link changes with each revision.

Solution:

To return the first file from a gist: https://gist.github.com/[gist_user]/[gist_id]/raw/

To get a file from multi–file gist: https://gist.github.com/[gist_user]/[gist_id]/raw/[file_name]

@cdl
cdl / music.txt
Last active January 31, 2019 02:04
Obelisk Film Festival music list
# Obelisk Film Festival
### Music for the Obelisk Film Festival to play during interludes/breaks/entrance.
Title
Artist - Album
* * * * * * * *
You've Got Something
The Jungle Giants - She's a Riot
@vitorbritto
vitorbritto / rm_mysql.md
Last active July 5, 2024 17:22
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

    brew remove mysql
    
@jaxgeller
jaxgeller / gist:14b6e0b7abd0219a38f1
Created July 8, 2015 16:12
Disable Cyberduck Bonjour Notifications
# in terminal
defaults write ch.sudo.cyberduck rendezvous.enable false
## How to hide API keys from github ##
1. If you have already pushed commits with sensitive data, follow this guide to remove the sensitive info while
retaining your commits: https://help.github.com/articles/remove-sensitive-data/
2. In the terminal, create a config.js file and open it up:
touch config.js
atom config.js
@dotspencer
dotspencer / terminal.txt
Created May 17, 2016 22:26
Change screenshot save location terminal
defaults write com.apple.screencapture location ~/Desktop/Screenshots/;killall SystemUIServer;
@dotspencer
dotspencer / download.js
Last active October 20, 2020 19:44
Simplest way to generate and download a file using Javascript
function download(filename, text){
// MIME types: https://www.freeformatter.com/mime-types-list.html#mime-types-list
var blob = new Blob([text], {type: "text/plain"});
var url = window.URL.createObjectURL(blob);
var a = document.createElement("a");
a.href = url;
a.download = filename;
a.click();
}
@dotspencer
dotspencer / simple.md
Last active February 1, 2024 02:34
Generate new SSH key gen (ssh-keygen and ssh-copy-id)