- Change
$path
and$uri
as necessary ingyazo.php
and upload it to your server - Change
HOST
andCGI
as necessary inscript
and use it to replaceGyazo.app/Contents/Resources/script
(right-click -> Show Package Contents to get there) - Continue along as usual
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 assert = require('assert') | |
, subclass = function(type, proto){ | |
// make sure we are extending a global constructor | |
// accepted: [Boolean, Number, String, Array, Object, Function, RegExp, Date] | |
if(!global[type.name] || global[type.name].name != type.name) throw new Error(); | |
var constructor = proto.constructor, | |
keys = Object.keys(proto), | |
Obj = process.binding('evals').Script.runInNewContext('x = '+type.name), // eval ftw |
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
#!/bin/bash | |
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF | |
appify v3.0.1 for Mac OS X - http://mths.be/appify | |
Creates the simplest possible Mac app from a shell script. | |
Appify takes a shell script as its first argument: | |
`basename "$0"` my-script.sh |
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
js> isNaN(null); | |
false | |
js> null > -1; | |
true | |
js> null < 1; | |
true | |
js> null > 0; | |
false | |
js> null < 0; | |
false |
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 arr = [], | |
obj = {'abcdef' : 1, 'qqq' : 13, '19' : [1, 2, 3, 4]}; | |
for(var i = 0; i < 5000; i++) | |
arr.push(obj); | |
// jsondb(arr) looks something like this: | |
// ["abcdef", "qqq", "19", [1, 13, [1, 2, 3, 4]], [1, 13, [1, 2, 3, 4]]...] | |
> JSON.stringify(arr).length //original |
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
### | |
# JSONDB - a compressed JSON format | |
# By Devon Govett | |
# Originally proposed by Peter Michaux - http://michaux.ca/articles/json-db-a-compressed-json-format | |
# | |
# jsondb.pack converts an array of objects with the same keys (i.e. from a database) | |
# and flattens them into a single array, which is much smaller than the pure json | |
# representation where the keys are repeated for each item in the array. | |
# Combine with JSON.stringify to send compressed JSON data over the network. | |
# |
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
<!doctype html> | |
<title>has touch?</title> | |
<h1>Has this device touch? </h1> | |
<script> | |
var isTouch = (function(){ | |
try{ | |
var event = document.createEvent("TouchEvent"); // Should throw an error if not supported | |
return !!event.initTouchEvent; // Check for existance of initialization method | |
}catch(error){ | |
return false; |
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
innerWidth / innerHeight tests @ http://sandbox.thewikies.com/orientation/ | |
-------------------------------------------------------------------------------- | |
Tested (14 devices, 28 browsers): | |
Droid 2 Global Android 2.2 | |
iPhone 4 iOS5 (Safari, Opera Mini) | |
Motorola Atrix Android 2.3.4 (Stock browser, Dolphin, Skyfire, Opera Mini, Firefox) | |
Samsung Galaxy S9000 Android 2.3 (Webkit, Opera Mobile) | |
Samsung Galaxy Y Android 2.3.5 |
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
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
// MIT license | |
(function() { | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; |
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
// Simulating infinite-length leading lookbehind in JavaScript. Uses XRegExp. | |
// Captures within lookbehind are not included in match results. Lazy | |
// repetition in lookbehind may lead to unexpected results. | |
(function (XRegExp) { | |
function prepareLb(lb) { | |
// Allow mode modifier before lookbehind | |
var parts = /^((?:\(\?[\w$]+\))?)\(\?<([=!])([\s\S]*)\)$/.exec(lb); | |
return { |
OlderNewer