View regex-weburl.js
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Updated: 2010/12/05
// License: MIT
//
// Copyright (c) 2010-2013 Diego Perini (http://www.iport.it)
//
// Permission is hereby granted, free of charge, to any person
View base-neg-2.js
'use strict';
function toDecimal(A) {
var sum = 0;
for (var i = 0; i < A.length; i++) {
sum += A[i] * Math.pow(-2, i);
}
return sum;
}
View x11-keylogger.c
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <signal.h>
#include <string.h>
#include <unistd.h> // for usleep() only
#include <sys/time.h>
#include <sys/types.h>
#include <time.h>
View ba-issemver.js
/*!
* isSemVer - v0.1 - 9/05/2010
* http://benalman.com/
* http://semver.org/
*
* Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
View AXWindow.swift
import Cocoa
class AXWindow {
let app: AXUIElement
let window: AXUIElement
init(app: AXUIElement, window: AXUIElement) {
self.app = app
self.window = window
View _ff-addon-snippet-AccessBootstrapScope.js
var getScope = function(aAddonId) { var XPIScope = Cu.import('resource://gre/modules/addons/XPIProvider.jsm'); return XPIScope.XPIProvider.activeAddons.get(aAddonId).bootstrapScope; }; a = getScope('MouseControl@jetpack');
View example.cpp
void *EventLoop(void *args)
{
int state;
pthread_setcancelstate (PTHREAD_CANCEL_ENABLE, &state);
pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, &state);
// In one thread run the event loop to get hotkey presses
EventHotKeyID gMyHotKeyID1, gMyHotKeyID2;
EventTypeSpec eventType;
View _ff-addon-snippet-WINAPI_FocusMostRecentWindowOfPID.js
Cu.import('resource://gre/modules/ctypes.jsm');
var lib = {
user32: ctypes.open('user32.dll')
}
var NULL = ctypes.cast(ctypes.uint64_t(0x0), ctypes.voidptr_t);
/* http://msdn.microsoft.com/en-us/library/ms633514%28VS.85%29.aspx
* HWND WINAPI GetTopWindow(
* __in_opt_ HWND hWnd
View lock.c
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
int main() {
int fd;
struct flock lock, savelock;
printf("F_GETLK: %d\n", F_GETLK);