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
// Extra headers required at beginning of file | |
#include <node.h> | |
#include <node/v8.h> | |
#include <node/node.h> | |
// Slightly different initializer | |
// Instead of instantiating a new object like normal swig-v8 does, we pass in the object and set attributes. The object becomes the module. |
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
" Add this to your ~/.vimrc | |
autocmd BufRead,BufNewFile */PluginData/ProgCom/* set filetype=KSPProgComASM |
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
# Put this in your .rspec for verbose and coloured output. Don't include this comment. | |
--colour --format documentation |
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 Attributify | |
def attributify(key, unprocessed=params[key]) | |
if unprocessed.is_a? Hash | |
specific_params = {} | |
unprocessed.each do |k,v| | |
if (v.is_a?(Hash) && !k.to_s.match(/_attributes$/)) or (v.is_a?(Array) && !k.to_s.match(/_ids$/)) | |
# Nested, so suffix with '_attributes' | |
specific_params["#{k}_attributes".to_sym] = attributify(key, v) |
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
# Use whatever your sysadmin says your settings are supposed to be | |
# ... | |
# ... | |
# The problem we had was that the SMTP server our outsourced sysadmin | |
# would send emails to Gmail, but they would not be received by the MS | |
# Exchange that he had set up for us. Our Rails mailer config was | |
# causing a spurious value in the SMTP "MAIL FROM" statement. This | |
# fixes it: |
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
"If you know exactly what you're going to do, what's the good of doing it? Since you know, the exercise is pointless. It is better to do something else." | |
-- Picasso |
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
bin_PROGRAMS = some_node_module | |
some_node_module$(EXEEXT): | |
-cd $(NODE_MODULE_DIR) && node-gyp build | |
clean-local: | |
-cd $(NODE_MODULE_DIR) && node-gyp clean |
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
## Why? | |
You spent countless hours installing stuff on a CentOS box, only to have to move it to AWS. You should have used chef or puppet, but didn't have time. | |
## Steps | |
Please excuse the format and the amateurishness. | |
(1) Launch the closest instance you can find to what you need. This is so you can replace config on your old box. |
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
#include "image_view_renderer.h" | |
#include <string> | |
#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091 | |
#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092 | |
const std::string vertex_shader_source = "" | |
"#version 130\n" | |
"\n" | |
"in vec2 corners;\n" |
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
#/usr/bin/octave | |
% | |
% Map environment from brain scans | |
% | |
% http://headit-beta.ucsd.edu/recording_sessions/3a7b9ff6-385a-11e3-b29d-0050563f2612 | |
% | |
% PCA filter the first 2 seconds. | |
% | |
% Eigen-decomposing the covariance matrix is the least efficient but easiest way to do PCA. |
OlderNewer