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
-(NSArray *)playlistsInFolder:(SPPlaylistFolder *)aFolder { | |
NSMutableArray *playlists = [NSMutableArray arrayWithCapacity:[[aFolder playlists] count]]; | |
for (id playlistOrFolder in aFolder.playlists) { | |
if ([playlistOrFolder isKindOfClass:[SPPlaylist class]]) { | |
[playlists addObject:playlistOrFolder]; | |
} else { | |
[playlists addObjectsFromArray:[self playlistsInFolder:playlistOrFolder]]; | |
} |
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 Serializer { | |
public static void main(String[] args) throws Exception { | |
// Serialize an int[] | |
ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream("test.ser")); | |
out.writeObject(new int[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}); | |
out.flush(); | |
out.close(); |
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
<object id="3" type="application/x-java-applet" width="1" height="1"> | |
<param name="code" value="AppletTest" /> | |
<param name="archive" value="/static/live-connect-test/applet.jar?v=1333787038631" /> | |
<param name="mayscript" value="true" /> <param name="id" value="3" /> | |
</object> |
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
<? | |
$arr = array(); | |
$arr[0] = $_POST["PID"]; | |
$arr[1] = $_POST["VER"]; | |
// Connect database. | |
$host="localhost"; | |
$db_user="USER_OF_DATABASE_VARIABLE"; //Whatever your user name is | |
$db_password="USER_OF_DATABASE_VARIABLE_PASSWORD"; | |
$database="NAME_OF_DATABASE"; |
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()); })(); |
OlderNewer