Define DynamicKeyword 'ExecTest'
Note: Don't copy&paste from following code. PowerShell SyntaxHighlighter remove some lines. Instead, use RAW view.
#Requires -Version 4.0
Set-StrictMode -Version Latest
#define LUA_LIB | |
#include <lua.h> | |
#include <lauxlib.h> | |
static lua_Integer posrelat(lua_Integer pos, size_t len) { | |
if (pos >= 0) return pos; | |
else if (0u - (size_t)pos > len) return 0; | |
else return (lua_Integer)len + pos + 1; | |
} |
// Listens when new request | |
chrome.webRequest.onHeadersReceived.addListener(function(details) { | |
for (i = 0; i < details.responseHeaders.length; i++) { | |
if (isCSPHeader(details.responseHeaders[i].name.toUpperCase())) { | |
var csp = details.responseHeaders[i].value; | |
// append "https://mysite.com" to the authorized sites | |
csp = csp.replace('script-src', 'script-src https://mysite.com'); | |
csp = csp.replace('style-src', 'style-src https://mysite.com'); |
tell application "Evernote" | |
set the_notes to selection | |
set the_dialog to display dialog "What would you like to title these notes?" default answer "" | |
set the_title to text returned of the_dialog | |
set the_count to 1 |
/** | |
* Changes the resolution of a display on Windows. | |
* Useful for fixing the size of Wine's virtual desktop. | |
* | |
* Released into the public domain. | |
* http://creativecommons.org/publicdomain/zero/1.0/ | |
*/ | |
#include <stdio.h> | |
#include <wchar.h> |
Open the find/replace dialog. | |
At the bottom will be some Search mode options. Select "Extended (\n \r \t \0 \x...)" | |
In either the Find what or the Replace with field entries, you can use the following escapes: | |
\n new line (LF) | |
\r carriage return (CR) | |
\t tab character | |
\0 null character | |
\xddd special character with code ddd |
license: gpl-3.0 |
Function.prototype.bind = function (context) { | |
if (typeof this !== 'function') { | |
throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable"); | |
} | |
var fn = this, // the function to bind | |
slice = Array.prototype.slice // cache slice method | |
args = slice.call(arguments, 1), // get the array of addtional arguments (to be curried) | |
noop = function () {}, // the intermediate function to serve as a prototype chain connector | |
// (assuming we don't have Object.create() here) | |
bound = function () { |
tell application "Flint" to activate -- needs to be in front | |
tell application "System Events" to tell application process "Flint" | |
try | |
get properties of window 1 | |
set size of window 1 to {700, 800} | |
set position of window 1 to {1700, 300} | |
end try | |
end tell | |
tell application "Adium" to activate -- needs to be in front |
var assert = require('assert'); | |
function timer(fun) { | |
var start = Date.now(); | |
try { | |
fun() | |
} catch(e) { | |
console.error(e); | |
} | |
console.log((Date.now() - start) / 1000 + 's'); |