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 callBack(config) { | |
+ Katex.dollarInline = config.dollarInline; | |
+ deferred.resolve(config); | |
+ } | |
+ // do the async call to the socket. | |
+ socket.emit('plugins.Katex.getConfig', callBack); |
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
// http://bost.ocks.org/mike/shuffle | |
function shuffle(array) { | |
var len = array.length; | |
var temp, i; | |
while(len) { | |
i = Math.floor(Math.random() * len--); | |
temp = array[len]; | |
array[len] = array[i]; |
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
This script is for QtTabBar, an awesome extension for windows explorer. | |
It just removes all dots from the selected file names except the last dot. |
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
This script is for QtTabBar, an awesome extension for windows explorer. | |
This will copy the contents of all selected folders into the current folder and delete the folder if afterwards its empty. | |
I have a habit of putting everything my mates drop off in new folders so I can keep track of where I and others are up to. | |
Eventually I sort all the files out and its a bit of a pain going in them all, this fixes that. |
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
Goes through all selected folders (one deep) and checks if a wav file with the same name of a flac files exists and if it does then delete it. | |
This is my first script for QtTabBar....one of the best extensions to Windows, EVER! | |
`qs.InvokeCommand( "DeleteFile", fc.item().Path);` | |
Didnt work for me, complains the command doesnt exist. If I try using the command code of 125 then it doesnt bitch but it doesnt seem to do anything either. Using the fso.DeleteFile worked fine, except it didnt send it to the recycle bin which would have been nice, but I spose theres something for that but didnt look coz its working ;). |
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 p1 = { | |
x: 20, | |
y: 20 | |
}; | |
var p2 = { | |
x: 40, | |
y: 40 | |
}; |
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 all = []; | |
function parseTemplate (str) { | |
var re = /(\\r\\n|\\r|\\n)|{[(](.*?)[)]}|{{(.*?)}}/g; | |
re.lastIndex = 1; | |
var matches; | |
var last = 1; | |
var line = lastLine = lineEndPos = lineReturnPos = returnPos = 0; | |
str = JSON.stringify(str); // dont forget that this adds a quote character at the beginning and end of the string | |
parseTemplate.template = str; | |
while ((matches = re.exec(str)) !== null) { |
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 getFnName(fn) { | |
var f = typeof fn == 'function'; | |
var s = f && ((fn.name && ['', fn.name]) || fn.toString().match(/function ([^\(]+)/)); | |
return (!f && 'not a function') || (s && s[1] || 'anonymous'); | |
} | |
console.log(getFnName(String)); // 'String' | |
console.log(getFnName(function test(){})); // 'test' | |
console.log(getFnName(function (){})); // 'anonymous' |
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 colorToHSL(red, green, blue) { | |
var luminance, hue, saturation; | |
red = red / 255; | |
green = green / 255; | |
blue = blue / 255; | |
var vmax = Math.max(Math.max(red, green), blue); | |
var vmin = Math.min(Math.min(red, green), blue); | |
var delta = vmax - vmin; | |
var luminance = (vmax + vmin) / 2; | |
if (delta > 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
// http://jsfiddle.net/justin_c_rounds/Gd2S2/ | |
function checkLineIntersection(startX1, startY1, endX1, endY1, startX2, startY2, endX2, endY2, result) { | |
// if the lines intersect, the result contains the x and y of the intersection (treating the lines as infinite) and booleans for whether line segment 1 or line segment 2 contain the point | |
var denominator, a, b, numerator1, numerator2, result = result || { | |
x: 0, | |
y: 0, | |
onLine1: false, | |
onLine2: false | |
}; | |
denominator = ((endY2 - startY2) * (endX1 - startX1)) - ((endX2 - startX2) * (endY1 - startY1)); |