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
require 'active_record' | |
# Migrating from http://github.com/tobi/delayed_job to http://github.com/collectiveidea/delayed_job | |
# and with some jobs pending resulted in execution failure due to handler format incompatibility. | |
# | |
# This rake task loops through your delayed_jobs table and updates the handler of each job to comply with | |
# collectiveidea's delayed_job. | |
# | |
# Hope this can be useful to someone. | |
# |
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
# | |
# Adapted from http://pastebin.com/FL5KeQQH | |
# | |
# As mentioned on the link above put this on app/helpers/pagination.rb | |
# and you can use in your view | |
# | |
# =will_paginate @posts | |
# | |
# I'm also using this https://gist.github.com/837683 | |
# |
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
(defun pickaxe (directory) | |
(inotify:with-inotify (inot `((,directory ,(logior inotify:in-create | |
inotify:in-moved-to)))) | |
(write-line "Waiting for sales...") | |
(loop | |
(dolist (event (inotify:read-events inot)) | |
(when (equal | |
(pathname-type (inotify:event-full-name event)) | |
"xml") | |
(if (string-equal directory "/path/to/dropbox/") |
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
;; DISCONNECT_REQ | |
(defun disconnect-req () | |
(with-buffer (make-buffer) | |
(serialize* :uint8 27 | |
:uint16 8 | |
:uint16 32865 | |
:uint16 29 | |
:uint16 7))) ;; command code |
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
<% | |
require 'cgi' | |
require 'uri' | |
begin | |
uri = URI.parse(ENV["DATABASE_URL"]) | |
rescue URI::InvalidURIError | |
raise "Invalid DATABASE_URL" | |
end |
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
$ heroku run bash | |
Running `bash` attached to terminal... up, run.1256 | |
~ $ cd sbcl/sbcl-1.0.54-x86-64-linux/ | |
~/sbcl/sbcl-1.0.54-x86-64-linux $ chmod +x run-sbcl.sh | |
~/sbcl/sbcl-1.0.54-x86-64-linux $ ./run-sbcl.sh | |
(running SBCL from: /app/sbcl/sbcl-1.0.54-x86-64-linux) | |
This is SBCL 1.0.54, an implementation of ANSI Common Lisp. |
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
(defun build-matrix () | |
(let* ((n-nodes (length (nodes))) | |
(dim `(,n-nodes ,n-nodes))) | |
(gsll:set-zero (grid:make-foreign-array 'double-float :dimensions dim)))) | |
(defparameter *adj-matrix* nil) | |
(defparameter *diag-matrix* nil) | |
(defmacro with-matrix (matrix &body body) | |
`(loop for i below (first (grid:dimensions ,matrix)) do |
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
Hi, | |
After trying out GSLL, Clem, also FemLisp, Lisplab managed to get me | |
the functionality I needed with the least trouble. | |
I'm trying to get the connectivity of a graph (second smallest eigen value) from eigenvalues. | |
Given the fully connected 4x4 adjacency matrix: | |
#md(( 0.000 1.000 1.000 1.000 ) |
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
(defparameter *world* nil) | |
(defclass tile () | |
((x :initarg :x | |
:accessor x) | |
(y :initarg :y | |
:accessor y) | |
(size :initarg :size | |
:accessor size) | |
(color :initarg :color |
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
/* The purpose of this program is to monitor routing | |
* table changes | |
*/ | |
#include <sys/socket.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <linux/netlink.h> | |
#include <linux/rtnetlink.h> |
OlderNewer