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
;;;; -*- Mode: Lisp -*- | |
(in-package :stumpwm) | |
(ql:quickload 'swank) | |
(ql:quickload :alexandria) | |
(swank-loader:init) | |
(defcommand swank () () | |
(setf stumpwm:*top-level-error-action* :break) | |
(swank:create-server :port 4004 |
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
(ql:quickload :bordeaux-threads) | |
(defcommand alert-me-at (alert-hour alert-minute message) ((:number "hour: ") (:number "minute: ") (:string "message: ")) | |
"Alert me at some point in time. Doesn't handle time too early, so the thread will go on forever." | |
(bordeaux-threads:make-thread | |
#'(lambda () | |
(loop | |
do (sleep 5) | |
when (multiple-value-bind (seconds minute hour) | |
(get-decoded-time) |
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
sudo sbcl --load quicklisp.lisp --eval '(quicklisp-quickstart:install :path #p"/usr/share/quicklisp/quicklisp")' | |
# Maybe put the /usr/share/quicklisp/ folder straight in the package. | |
# quicklisp is downloaded in /usr/share/quicklisp/quicklisp so that /usr/share/quicklisp is available | |
# for other files, such as the helpers for quickloading global systems. | |
# The quicklisp.lisp file should be in /usr/share/quicklisp/, so that it's reusable | |
# for local installs. See /usr/bin/ql-local-install |
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
/* | |
The service, run as root, will listen on the /var/run/hermes.sock | |
socket. The only command it will understand is a four-bytes long | |
command, being a number mapping an action. | |
Really, only one action is needed: get me the content of the | |
connected hermes device. Having 4 bytes is cheap enough, and leaves | |
other possibilities later on, if needed. | |
The "get me the content" command needs the value "1". It can return |
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
module.exports = { | |
io: null, | |
socket: null, | |
createReactiveMethod: function() {}, | |
initialize: function(server) { | |
console.log("initialized!"); | |
this.io = require('socket.io').listen(server); | |
var that = this; |
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
var UserCollection = require("../dataSources/user") | |
var User = { | |
find: function( name, skypeName, callback ) { | |
if ( skypeName ) { | |
findBySkypeName( name, callback ); | |
} | |
// The rest of your logic there | |
} | |
} |
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
// Assume errorPage, jsonBody, formBody exist within scope. | |
function methods(routes, handleHttpForms) { | |
if (handleHttpForms) { | |
return createHttpFormsRequestHandler(routes) | |
} | |
return requestHandler.bind(this) | |
} | |
function requestHandler(req, res) { |
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
/** | |
* A little script that will screw up people using campaigns on Google | |
* Analytics. | |
* | |
* Do. Not. Use. | |
* | |
* I am not responsible for any action that people may employ using this | |
* little script. It was done purely out of curiosity. | |
* | |
* Usage: |
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
var ncore = require( 'ncore' ); | |
ncore.constructor( { | |
"./other.js": { | |
"test": "./test.js" | |
} | |
}); | |
console.log( ncore ); |
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
// Untested, off-the-cuff | |
$.fn.secondClick = function(handler) | |
{ | |
if ( !$( this ).data( 'click' ) ) { | |
$( this ).data( 'click', 1 ); | |
} | |
else if ( $( this ).data( 'click' ) === 1 ) { | |
handler(); | |
$( this ).data( 'click', '' ); | |
} |