Skip to content

Instantly share code, notes, and snippets.

@ProjectMoon
ProjectMoon / Stack Trace
Created March 6, 2011 00:03
Stack Trace for error
Error: Can't use mutable header APIs after sent.
at ServerResponse.getHeader (http.js:521:11)
at ServerResponse.header (/usr/local/lib/node/.npm/express/2.0.0beta/package/lib/response.js:225:17)
at ServerResponse.send (/usr/local/lib/node/.npm/express/2.0.0beta/package/lib/response.js:65:17)
at ServerResponse.render (/usr/local/lib/node/.npm/express/2.0.0beta/package/lib/view.js:301:10)
at ServerResponse.render (/usr/local/lib/node/.npm/express/2.0.0beta/package/lib/view.js:295:10)
at /home/jeff/Programs/JavaScript/scrappersave/src/controllers/UserController.js:11:9
at /usr/local/lib/node/.npm/mongoose/1.1.3/package/lib/mongoose/query.js:558:22
at model.<anonymous> (/usr/local/lib/node/.npm/mongoose/1.1.3/package/lib/mongoose/document.js:141:5)
at model.init (/usr/local/lib/node/.npm/mongoose/1.1.3/package/lib/mongoose/document.js:571:33)
@ProjectMoon
ProjectMoon / UserController.js
Created March 6, 2011 19:42
Fuller code example showing the MVC implementation
//This is a pared-down example of my application's file.
var app = module.exports = express.createServer();
//Configure app...
//Define controller.
var UserController = new ActionController('/users/', {
show: {
get: function(req, res) {
@ProjectMoon
ProjectMoon / main.c
Created April 14, 2011 21:52
Files illustrating simple attempt at making a D shared library with GDC.
#include <stdio.h>
#include <dlfcn.h>
#include <stdlib.h>
void main() {
void (*hiD)(void);
void* handle = dlopen("./libtest.so", RTLD_LAZY);
if (handle == NULL) {
printf("%s\n", dlerror());
exit(1);
@ProjectMoon
ProjectMoon / .gitignore
Created May 4, 2011 16:10
Function Expressions: first file is the grammar I want to use, demonstrating the problem. The second (example.eve) demonstrates what must be done currently in the language vs what I would like to achieve.
lib/
*.java
*.tokens
@ProjectMoon
ProjectMoon / ASM Build Warnings
Created June 24, 2011 14:39
Javaflow build errors
[javaflow] org.objectweb.asm.tree.analysis.AnalyzerException: Error at instruction 4: java.lang.ClassNotFoundException: eve.statements.loop.WhileLoop
[javaflow] at org.objectweb.asm.tree.analysis.Analyzer.analyze(Unknown Source)
[javaflow] at org.apache.commons.javaflow.bytecode.transformation.asm.ContinuationMethodAnalyzer$2.analyze(ContinuationMethodAnalyzer.java:128)
[javaflow] at org.apache.commons.javaflow.bytecode.transformation.asm.ContinuationMethodAnalyzer.visitEnd(ContinuationMethodAnalyzer.java:139)
[javaflow] at org.objectweb.asm.ClassReader.accept(Unknown Source)
[javaflow] at org.objectweb.asm.ClassReader.accept(Unknown Source)
[javaflow] at org.apache.commons.javaflow.bytecode.transformation.asm.AsmClassTransformer.transform(AsmClassTransformer.java:49)
[javaflow] at org.apache.commons.javaflow.bytecode.transformation.asm.AsmClassTransformer.transform(AsmClassTransformer.java:41)
[javaflow] at org.apache.commons.javaflow.utils.RewritingUtils.rewriteClassFile(RewritingUtils.java
@ProjectMoon
ProjectMoon / crypt.js
Created July 20, 2011 20:12
Is there a problem with encrypting/decrypting binary files, or am I doing it wrong?
//invoke with a filename to encrypt and decrypt a specific file.
var fs = require('fs'),
crypto = require('crypto');
var ALG = 'aes256';
var KEY = 'test';
var ENCODING = 'hex';
var FILE = process.argv[2] || 'file.txt';
@ProjectMoon
ProjectMoon / control.jison
Created August 20, 2011 16:52
jscore lexer + grammar
/* http://www.opensource.apple.com/source/JavaScriptCore/ */
/*
Lexer defintion, gleaned from Keywords.table and Lexer.cpp
*/
%lex
%%
\s+ /* skip whitespace */
@ProjectMoon
ProjectMoon / README.md
Last active January 6, 2023 17:31
Patch that disables Subsonic license checking and validation

Update 2020 Edition: Use something like Airsonic instead. Subsonic's code is closed source at this point, and thus this patch is useless, unless you are using a 9 year old verison of Subsonic for some reason.


A patch to disable the licensing functionality in Subsonic, a GPL-licensed media streaming server/web interface. Use of the mobile apps requires you to get a license after 30 days of trial. You obtain a license via donation.

Except that's not a donation. So, here's a patch to fix that. Support the Subsonic project with a donation that's actually a donation. The program is developed and maintained very well.

Steps to victory

@ProjectMoon
ProjectMoon / debug output
Created December 1, 2011 13:04
Dante SOCKS client configuration
Dec 8 13:11:52 (1323367912.804215) rtorrent[27139]: debug: ifname2sockaddr(): no interface with the name "proxy.btguard.com" found
Dec 8 13:11:52 (1323367912.804658) rtorrent[27139]: debug: socks_rmaddr(): not freeing buffer for fd 8, issyscall
Dec 8 13:11:52 (1323367912.804799) rtorrent[27139]: debug: socks_rmaddr(): not freeing buffer for fd 8, issyscall
Dec 8 13:11:52 (1323367912.804842) rtorrent[27139]: debug: Rconnect(): socket 8, address 192.168.1.1.53
Dec 8 13:11:52 (1323367912.804882) rtorrent[27139]: debug: socks_rmaddr(): not freeing buffer for fd 8, issyscall
Dec 8 13:11:52 (1323367912.804918) rtorrent[27139]: debug: Rconnect(): doing socks_rmaddr(8) before continuing ...
Dec 8 13:11:52 (1323367912.804948) rtorrent[27139]: debug: socks_freebuffer(): socket 8
Dec 8 13:11:52 (1323367912.804989) rtorrent[27139]: debug: socks_rmaddr(): not freeing buffer for fd 8, issyscall
Dec 8 13:11:52 (1323367912.805028) rtorrent[27139]: debug: socks_rmaddr(): not freeing buffer for fd 8, issyscall
Dec 8
@ProjectMoon
ProjectMoon / Console Output
Created March 12, 2012 18:28
NPM installation issues
[node@theflux ~/stories]$ npm install
> [email protected] preinstall /home/node/stories
> rm -rf build && mkdir -p build && cd build && git clone git://github.com/ajaxorg/ace.git && cd ace && git submodule update --init --recursive
Cloning into ace...
remote: Counting objects: 22005, done.
remote: Compressing objects: 100% (6013/6013), done.
remote: Total 22005 (delta 15899), reused 20412 (delta 14467)
Receiving objects: 100% (22005/22005), 8.20 MiB | 1.47 MiB/s, done.