Skip to content

Instantly share code, notes, and snippets.

View aaronmoodie's full-sized avatar
Coffee

Aaron Moodie aaronmoodie

Coffee
View GitHub Profile
@aaronmoodie
aaronmoodie / gitCommands.bash
Last active August 29, 2015 13:55
My Collection of git commands
$ git log #show commit history
$ git revert <hash> # reverts changes in that commit
$ git show <hash> | gist -t diff # create diff of commit and pipe to gist
$ git diff —staged # show diff of added (staged files)
$ git rebase -i # interactive rebase
$ git rebase —abort # undo a rebase
$ git cherrypick <hash> # moves a commit from one branch to another
$ git push origin <branch> # push review/branch to github
$ git commit —amend # add changes to the last commit
$ git stash show <stash name> # view changes in stash

Keybase proof

I hereby claim:

  • I am aaronmoodie on github.
  • I am aaronmoodie (https://keybase.io/aaronmoodie) on keybase.
  • I have a public key whose fingerprint is 09BE 3685 A583 684F 5776 FB2B 88EE 7158 C521 01D2

To claim this, I am signing this object:

<script>
var meta_tag = document.createElement('meta');
meta_tag.setAttribute('name', 'last-modified')
meta_tag.setAttribute('content', document.lastModified)
document.getElementsByTagName('head')[0].appendChild(meta_tag)
</script>
int main(int argc, const char * argv[])
{
int x = 0;
int *pointer_to_x = &x; // * is used to do declaration (use & to get the address of x in memory)
*pointer_to_x = 1; // * is a dereference operator
//x is now equal to 1
printf("*pointer_to_x points to the value %i\n", *pointer_to_x);
printf("pointer_to_x is located at the address %p\n\n", pointer_to_x);
> function Element() {}
undefined
> Element.prototype.render = function() {};
[Function]
> var e = new Element();
undefined
> e.render();
undefined
> e.toString();
'[object Object]'
create_table "product", :force => true do |t|
t.string "name"
t.enum "type" # booklet, tutorial etc
end
create_table "physical_product", :force => true do |t|
t.integer "product_id"
# unique attrs
end
atom-text-editor::shadow atom-text-editor-minimap {
background: #282C34;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Cross-browser kerning-pairs & ligatures</title>
<style>
body { font-family: sans-serif; background: rgba(30, 10, 0, 0.05); color: rgba(40, 30, 0, 1); width: 500px; margin: 80px auto; padding: 0px; }
a { color: rgba(15, 10, 0, 0.8); text-decoration: none; border-bottom: 1px solid; padding: 1px; -webkit-transition: background 1s ease; }
a:hover { background: rgba(0, 220, 220, 0.2); }
p { line-height: 1.5; padding: 0px 1em 0em 0em; }
def download_file(url)
request = "GET #{url} HTTP/1.0\r\n\r\n"
host = /^https?:\/\/([^\/]+)/.match(url.to_s)
socket = TCPSocket.open(host[1].to_s,80)
socket.print(request)
# find beginning of response body
buffer = ""
while !buffer.match("\r\n\r\n") do
function getImages(setID) {
$.getJSON("http://api.flickr.com/services/rest/?method=flickr.photosets.getPhotos&api_key=yourKeyhere8&photoset_id=" + setID + "&lang=en-us&format=json&jsoncallback=?", displayImages);
}
function displayImages(data) {
var htmlString = "";
$.each(data.photoset.photo, function(i,photo){
var imgSrc = 'http://farm' + photo.farm + '.static.flickr.com/' + photo.server + '/' + photo.id + '_' + photo.secret + '_b.jpg';
htmlString += '<img title="' + photo.title + '" src="' + imgSrc;