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
/** | |
* Advanced timer with ability to pause/resume the callback. | |
* @param {function} callback - Callback to be executed after some delay. | |
* @param {number} delay - Delay. | |
* @returns {Object} Timer object with useful methods. | |
*/ | |
var timer = function (callback, delay) { | |
var isPaused = true; | |
var timer, start, clear, pause, resume; |
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
# YOU NEED TO INSERT YOUR APP KEY AND SECRET BELOW! | |
# Go to dropbox.com/developers/apps to create an app. | |
app_key = 'YOUR_APP_KEY' | |
app_secret = 'YOUR_APP_SECRET' | |
# access_type can be 'app_folder' or 'dropbox', depending on | |
# how you registered your app. | |
access_type = 'app_folder' |
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
# | |
# cam.py | |
# | |
# usage: python cam.py [infile] [xoffset yoffset] [display size] [outfile] [undercut] | |
# | |
# input: | |
# *.dxf: DXF (polylines) | |
# *.cmp,*.sol,*.plc: Gerber | |
# RS-274X format, with 0-width trace defining board boundary | |
# *.drl: Excellon drill file, with tool defitions |
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
// can be used for JSONP calls too | |
var loadScript = function(url, callback) { | |
var script = document.createElement('script'); | |
script.setAttribute('src', url); | |
script.setAttribute("type","text/javascript"); | |
script.setAttribute('async', true); | |
// wait for script to load | |
var onLoaded = function(script,callback) { | |
return function() { | |
// remove the script |
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> | |
<head> | |
<title>Hotkey Demo</title> | |
<script type="text/javascript" src='keymap.js'></script> | |
<script type="text/javascript"> | |
function log(message) { | |
document.getElementById('log').textContent += message + '\n'; | |
} | |
var gui = require('nw.gui'); |
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
/* CSS Photo Album */ | |
/* Rebound of this shot by @daryl: http://drbl.in/fwwM */ | |
* { | |
margin: 0; | |
padding: 0; | |
position: relative; | |
box-sizing: border-box; | |
} |
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
AL = function(type, url, callback) { | |
var el, doc = document; | |
switch(type) { | |
case 'js': | |
el = doc.createElement('script'); | |
el.src = url; | |
break; | |
case 'css': | |
el = doc.createElement('link'); |
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 sys | |
from PyQt4 import QtCore, QtGui, QtWebKit | |
import WebGui | |
"""Html snippet.""" | |
html = """ | |
<html><body> | |
<center> | |
<script language="JavaScript"> | |
document.write('<p>Python ' + pyObj.pyVersion + '</p>') |
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() | |
{ | |
var global = this; | |
var createXmlHttpRequest = (function() | |
{ | |
var i, | |
fs = [// for legacy eg. IE 5 | |
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
function getXMLHttpRequest() { | |
if ( _root.defined( `XMLHttpRequest ) ) | |
return new XMLHttpRequest(); | |
else { | |
try { | |
return ActiveXObjectFactory.createObject( "MSXML2.XMLHTTP.3.0" ); | |
} catch ( e : Exception ) { | |
return null; | |
} | |
} |
NewerOlder