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 arr = [1,3,2,4]; | |
console.log(arr); | |
var sorted_arr = arr.sort(); | |
console.log(sorted_arr); | |
console.log(arr); | |
// prints what i don't want | |
// [1,3,2,4] | |
// [1,2,3,4] | |
// [1,2,3,4] |
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
// preventing click behavior when sorting links using jquery-ui's (1.6b) sortable widget | |
'stop': function(e,ui) { | |
ui.item.find('a').click(function(e){ | |
e.preventDefault(); | |
}); | |
setTimeout(function(){ | |
ui.item.find('a').unbind('click'); | |
},10); | |
addFeatured(); | |
}, |
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
// event handler for queuing a file | |
'fileQueued': function(file) { | |
// check if you queued a video | |
// get upload url | |
if (file.name.toLowerCase().match("(mov|avi|wmv|3gp|mkv|mpg|mpeg|mp4|m4v)$")) { | |
var input = {'get_fields[]': ['url','key'],'file': file.name }; | |
$.getJSON('/media/get_video_upload_url',input,function(output){WU.sv_urls[file.id] = output;}); | |
} | |
// switch to upoad view |
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
<style type="text/css"> | |
.wrap { position: relative; } | |
.centered { position: absolute; top: 50%; left: 50%; width: 20px; height: 20px; margin-left: -10px; margin-top: -10px; } | |
</style> | |
<div class="wrap"><div class="centered">I'm centered</div></div> |
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
$button_color: orange !default | |
=button($color: $button_color, $size: large) | |
display: inline-block | |
outline: none | |
cursor: pointer | |
text-align: center | |
text-decoration: none | |
line-height: 137% | |
font-weight: bold |
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
<a href="#js_table_1" class="toggle-table">table 1</a> | |
$('.toggle-table').click(function(e) { | |
e.preventDefault(); | |
var table = $($(this).attr('href')); | |
if (table.is(':visible')) { | |
table.fadeOut('slow') | |
} else { | |
table.fadeIn('slow') | |
} |
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 | |
class File_Streamer | |
{ | |
private $_fileName; | |
private $_contentLength; | |
private $_destination; | |
public function __construct() | |
{ | |
if (!isset($_SERVER['HTTP_X_FILE_NAME']) |
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
// INPUT | |
(function() { | |
function this_is_my_great_function(msg) { | |
alert(msg); | |
} | |
this_is_my_great_function('yay'); | |
}); | |
// YUI COMPRESSED OUTPUT | |
(function(){function a(b){alert(b)}a("yay")}); |
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
dl | |
dt | |
something | |
dd | |
something else |
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
import os | |
import sublime, sublime_plugin | |
import urllib, urllib2 | |
#view.run_command("compress") | |
class CompressCommand(sublime_plugin.TextCommand): | |
def run(self, edit): | |
folder_name, file_name = os.path.split(self.view.file_name()) | |
sublime.status_message(("Compressing %s...") % file_name) |
OlderNewer