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. |
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
load "brain1_denoised.mat" | |
% test signals | |
% | |
%result = zeros(1, 512); | |
%result = sin(2*pi*(1:2048)*20/512) + cos(2*pi*(1:2048)*6/512); | |
result = (result-mean(result))/max(result); | |
printf("Denoised brain data loaded\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
{-# LANGUAGE CPP #-} | |
-- it draws a triangle. | |
import Graphics.UI.GLUT | |
import Graphics.Rendering.OpenGL | |
import Foreign.Marshal.Array | |
import Foreign.Storable | |
import Foreign.Ptr | |
import qualified Data.ByteString as B |
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: ruby -*- | |
# vi: set ft=ruby : | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "ubuntu/trusty64" |
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
import GHCJS.Foreign | |
import GHCJS.Types | |
data DontTouchThis | |
foreign import javascript "js_testFunc" js_testFunc :: JSFun (JSRef DontTouchThis -> IO JSString) -> IO () | |
main :: IO () | |
main = js_testFunc =<< syncCallback1 AlwaysRetain True (\_ -> putStrLn "bar" >> return (toJSString "quux")) |
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
import GHCJS.Foreign | |
import GHCJS.Types | |
foreign import javascript "js_testFunc" js_testFunc :: JSFun (JSString -> JSFun (JSString -> IO ()) -> IO () ) -> IO () | |
foreign import javascript "js_callCallback" js_callCallback :: JSFun (JSString -> IO ()) -> JSString -> IO () | |
main :: IO () | |
main = do | |
js_testFunc =<< syncCallback2 AlwaysRetain True (\passedIn returner -> do | |
putStrLn $ fromJSString passedIn |
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/env python3 | |
# | |
#import urllib.request | |
# | |
## Read XML from TFL website | |
# | |
#url = 'http://cloud.tfl.gov.uk/TrackerNet/LineStatus' | |
#response = urllib.request.urlopen(url) | |
#xml = response.read().decode('utf-8') | |
# |
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. |
OlderNewer