This file contains hidden or 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
exports.show = function() { | |
var win = Ti.UI.createWindow({ | |
title: 'Developer Tools', | |
layout: 'vertical' | |
}); | |
win.leftNavButton = Ti.UI.createButton({ title: 'Chiudi' }); | |
win.leftNavButton.addEventListener('click', function() { | |
(nav || win).close(); |
This file contains hidden or 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 getp(puzzle, x, y) { | |
var hash = {}; | |
for (var u = 0; u < 9; u++) hash[ puzzle[y][u] ] = 1; | |
for (var u = 0; u < 9; u++) hash[ puzzle[u][x] ] = 1; | |
for (var u = 0; u < 9; u++) hash[ puzzle[ 3*((y/3)|0) + ((u/3)|0) ][ 3*((x/3)|0) + (u%3) ] ] = 1; | |
var poss = []; | |
for (var i = 1; i <= 9; i++) if (!(i in hash)) poss.push(i); | |
return poss; | |
} |
This file contains hidden or 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 operators = { | |
'%': 2, | |
'*': 2, | |
'/': 2, | |
'^': 2, | |
'+': 1, | |
'-': 1 | |
}; | |
function toPostfix(expression) { |
This file contains hidden or 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
server { | |
server_name youtube.flerovio.dev; | |
location @404 { | |
return 302 /sq$request_uri; | |
} | |
error_page 404 = @404; | |
location ~ /sq/(.+) { |
This file contains hidden or 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 RomanNumerals = { | |
fromRoman: function(roman) { | |
var map = {IV:4,IX:9,XL:40,XC:90,CD:400,CM:900,I:1,V:5,X:10,L:50,C:100,D:500,M:1000}; | |
var value = 0; | |
for (var i = 0; i < roman.length; i++) { | |
var two = map[roman[i]+roman[i+1]], one = map[roman[i]]; | |
if (two != null) { value += two; i++; } | |
else if (one != null) value += one; | |
} | |
return value; |
This file contains hidden or 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 PrettyURL = { | |
parse: function(hash) { | |
hash = hash.replace('#', ''); | |
if (_.isEmpty(hash) || hash[0] != '/') return null; | |
var obj = {}; | |
_.each(hash.substr(1).split('/'), function(value) { | |
value = value.split(':', 2); | |
if (_.isEmpty(value[0])) return; | |
obj[value[0]] = value[1]; |
This file contains hidden or 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 B64(c) { | |
if (c == 63) return 47; | |
else if (c == 62) return 43; | |
else if (c >= 52) return c - 4; | |
else if (c >= 26) return c + 71; | |
else return c + 65; | |
} | |
function B10(c) { | |
if (c == 47) return 63; |
This file contains hidden or 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
task('pre:compile', function(event, logger) { | |
try { | |
require('fs').unlinkSync( require('path').join(process.cwd(), 'Resources', 'iphone', 'T', 'notifications.js') ); | |
logger.debug('Removed Push notifications entitlements'); | |
} catch (err) {} | |
}); |
This file contains hidden or 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 stream = require('stream'), | |
util = require('util'); | |
module.exports = WARCStream; | |
var STATE = { | |
PROTOCOL : 1, | |
HEADERS : 2, | |
CONTENT : 3, | |
SEPARATOR : 4 | |
}; |
This file contains hidden or 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 | |
function xml_decode($input) { | |
return current(xml2array(simplexml_load_string($input))); | |
} | |
function xml2array($xml) { | |
$arr = array(); | |
foreach ($xml->children() as $r) { | |
$t = array(); |