⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("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"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Queue | |
* | |
* @author JJ Ford | |
* | |
*/ | |
public class Queue { | |
private int size; | |
private Node front, back; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajax | |
# ... | |
beforeSend: (xhr) => | |
if xhr.upload? | |
xhr.upload.onprogress = => | |
console.log arguments... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grep --color='auto' -P -n "[\x80-\xFF]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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()); })(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{exp:channel:entries channel="podcast" status="open"} | |
///*********************************************************************************** | |
// This if statement doesn't work. content is shown for everyone no matter what | |
//************************************************************************************* | |
{if (group_id == "1" OR group_id == "7") && subscription_podcast != ""} | |
<item> | |
<title>{exp:xml_encode}{title}{/exp:xml_encode}</title> | |
<itunes:author>Lex and Terry</itunes:author> | |
<itunes:summary>{exp:xml_encode}{description}{/exp:xml_encode}</itunes:summary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ReverseString { | |
public static void main(String[] argv) { | |
String origString = argv[0]; | |
System.out.println(origString); | |
System.out.println(reverse(origString)); | |
} | |
public static String reverse(String str) { | |
if(str.length()<=1) return str; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################### | |
# .gitignore file for Xcode4 / OS X Source projects | |
# | |
# NB: if you are storing "built" products, this WILL NOT WORK, | |
# and you should use a different .gitignore (or none at all) | |
# This file is for SOURCE projects, where there are many extra | |
# files that we want to exclude | |
# | |
# For updates, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects | |
######################### |
OlderNewer