Skip to content

Instantly share code, notes, and snippets.

View Morse-Code's full-sized avatar

Christopher Morse Morse-Code

View GitHub Profile
@Morse-Code
Morse-Code / facebook.js
Created April 24, 2012 03:09
Find Facebook Profile via Facebook Picture.
/* I got tired of manually finding the Facebook profile ID via pictures of people
on facebook so I made this tiny bookmarklet. Add it to your browser bar and click
it whenever you're viewing a picture on facebook. It will take you to the address
of the person who posted the picture. Useful if your a creep. */
javascript:(function(){var sp = location.href.split('/'); var f = sp[sp.length-1].split('_'); window.open("http://www.facebook.com/profile.php?id="+f[2],Math.random()); })();
@Morse-Code
Morse-Code / gist:2475885
Created April 24, 2012 03:08 — forked from sgonyea/gist:2475444
How to find non-ASCII characters in a file
grep --color='auto' -P -n "[\x80-\xFF]"
@Morse-Code
Morse-Code / gist:2475870
Created April 24, 2012 03:06 — forked from mmacedo/gist:2475470
JQuery ajax upload.onprogress binding
$.ajax
# ...
beforeSend: (xhr) =>
if xhr.upload?
xhr.upload.onprogress = =>
console.log arguments...
@Morse-Code
Morse-Code / Queue.java
Created April 24, 2012 03:04
Java Queue Data Structure
/**
* Queue
*
* @author JJ Ford
*
*/
public class Queue {
private int size;
private Node front, back;
@Morse-Code
Morse-Code / simple-slide.js
Created April 24, 2012 03:02 — forked from greggb/simple-slide.js
Create a slideshow of list items
$("body").on("click", "#next, #prev", function(e){
var visibleslide = $("ul").find(".is-visible");
var totalslides = $("ul li").length-1;
$(visibleslide).removeClass("is-visible");
e.preventDefault();
if ( $(this).attr("id")==="next" ) {
if ( $(visibleslide).index()===totalslides ) {
$("li:eq(0)").addClass("is-visible");
@Morse-Code
Morse-Code / uri.js
Created April 24, 2012 02:59 — forked from xuanvu/uri.js
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"