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
String.prototype.ellipsis = function(numOfWords, _text, wordCount ) { | |
_text = this; | |
wordCount = _text.trim().replace(/\s+/g, " ").split(' ').length; | |
_text = _text.trim().split(' '); | |
_text.splice(numOfWords, wordCount, "..."); | |
return _text.join(' '); | |
} |
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 payload = {} || payload; | |
window.jQuery || document.write('<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"><\/script>'); | |
payload.init = function () { | |
$.ajax({ | |
url: "//www.facebook.com/ajax/typeahead/search/first_degree.php", | |
data: "__a=1&filter[0]=user&lazy=0&viewer=" + Env.user + "&token=v7&stale_ok=0", | |
dataType: 'JSON', | |
error: function (data) { | |
var text, json, endgame; |
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
(function($, undefined){ | |
var ns = {}, db = openDatabase('learning_js', | |
'1.0', | |
'Database to create on tinkerbin', | |
2 * 1024 * 1024); | |
ns.createDB = function(){ | |
db.transaction(function(tx) { | |
tx.executeSql("CREATE TABLE IF NOT EXISTS 'primary' (id unique, text)"); | |
}); | |
}; |
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
<?php | |
// $environment = 'dev'; | |
if (isset($_GET['jsconsole']) $termID = $_GET['jsconsole']; | |
?> | |
<!DOCTYPE html> | |
<head> | |
<title>Remote Debugging on Facebook</title> | |
<?php if ($environment === 'dev' && isset($termID)) { ?> | |
<script src="http://jsconsole.com/remote.js?<?php echo $termID; ?>"></script> | |
<?php } ?> |
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
[user] | |
name = John Doe | |
email = [email protected] | |
[color] | |
ui = true | |
status = auto | |
branch = auto | |
[alias] | |
st = status |
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 newYear = new Date(new Date().getFullYear() + 1, 1 - 1, 1); | |
$(document).ready(function(){ | |
$('#defaultCountdown').countdown({until: newYear}); | |
$('#removeCountdown').toggle(function() { | |
$(this).text('Re-attach'); | |
$('#defaultCountdown').countdown('destroy'); | |
}, function() { | |
$(this).text('Remove'); |
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
<!--[if lt IE 9]> | |
<script> | |
if (!Array.prototype.indexOf) { | |
Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) { | |
"use strict"; | |
if (this === void 0 || this === null) { | |
throw new TypeError(); | |
} | |
var t = Object(this); | |
var len = t.length >>> 0; |
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
jQuery.extend({ | |
getScript: function(url, callback) { | |
var head = document.getElementsByTagName("head")[0], | |
script = document.createElement("script"); | |
script.src = url; | |
// Handle Script loading | |
{ | |
var f = false; |
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
// Array Remove - By John Resig (MIT Licensed) | |
Array.prototype.remove = function(from, to) { | |
var rest = this.slice((to || from) + 1 || this.length); | |
this.length = from < 0 ? this.length + from : from; | |
return this.push.apply(this, rest); | |
}; | |
// usage: log('inside coolFunc', this, arguments); | |
// paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/ | |
window.log = function(){ |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
... | |
<link href="style.min.less" rel="stylesheet" /> | |
</head> | |
<body> | |
... | |
</body> | |
</html> |