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
Modernizr.load([ | |
{ | |
load: '//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.js', | |
complete: function () { | |
if ( !window.jQuery ) { | |
Modernizr.load('js/libs/jquery-1.6.1.min.js'); | |
} | |
} | |
}, | |
{ |
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
<script> | |
function bust () { | |
document.write = ""; | |
window.top.location = window.self.location; | |
setTimeout(function() { | |
document.body.innerHTML = ''; | |
}, 0); | |
window.self.onload = function(evt) { | |
document.body.innerHTML = ''; | |
}; |
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
// includes bindings for fetching/fetched | |
var PaginatedCollection = Backbone.Collection.extend({ | |
initialize: function() { | |
_.bindAll(this, 'parse', 'url', 'pageInfo', 'nextPage', 'previousPage'); | |
typeof(options) != 'undefined' || (options = {}); | |
this.page = 1; | |
typeof(this.perPage) != 'undefined' || (this.perPage = 10); | |
}, | |
fetch: function(options) { |
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
// Get the pagination information from the response headers | |
// Wrap Backbone.sync to save the pagination header on the response object. | |
Backbone.sync_with_pagination = function(method, model, success, error) { | |
var success_with_pagination = function(resp, status, xhr) { | |
resp.next_page = xhr.getResponseHeader('X-Next-Page'); | |
return success(resp); | |
} | |
return Backbone.sync_without_pagination(method, model, success_with_pagination, error); | |
}; |
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
#!/bin/sh | |
append_path () { | |
input="$1" | |
value="$2" | |
if ! echo $input | /usr/bin/egrep -q "(^|:)$value($|:)" ; then | |
if [ "$3" = "after" ] ; then | |
echo $input:$value | |
else | |
echo $value:$input |
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
Dka1C0PfRVSA7oyA6Z15Jv2N1v27cWffdYjC5DyGMx4h1Lnf/wDARy/FySqUPS+f31hHKRoA61Hp8Qru8kf8xxp6b1stoweyN3OMgg4RHEhiaa2AwnOvVoYMAJ1v |
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 interface ICache | |
{ | |
/// <summary> | |
/// Get the Type from Cache with key | |
/// </summary> | |
/// <typeparam name="T"></typeparam> | |
/// <param name="key"></param> | |
/// <returns></returns> | |
T Get<T>(string key); |
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
/// | |
/// Serialises an object to a unicode string | |
/// | |
/// The object to serialise | |
/// A string representing the serialised object | |
public static string Serialise(object objectToSerialise) | |
{ | |
//create an xml serialiser for the object's type | |
XmlSerializer ser = new XmlSerializer(objectToSerialise.GetType()); | |
//create a memory stream object to hold the data for the serialised type |
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
curl -X POST -H "Cache-Control: no-cache" -H "Postman-Token: 919ea746-ec49-11df-ddee-09482eedef73" -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" -F "f_name=你的名字" -F "l_name=你的姓氏Chen" -F "email=你的usc邮箱" -F "email_confirm=你的usc邮箱" -F "uscid=你的usc-id" -F "us_citizen=0" -F "save=Continue On To Course Preferences" "https://vsoeapp1.vsoe.usc.edu/non_cms_versions/course_preferences/" |
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
javascript:(function() { | |
var offers = {}; | |
var delayBetweenCards = 3000; | |
var cardCount = document.getElementsByClassName("iNCWCardArt").length; | |
function goToNextCard(cardNumber) { | |
document.getElementsByClassName("iNCWCardArt")[cardNumber].click(); | |
} |
OlderNewer