Skip to content

Instantly share code, notes, and snippets.

@BlackMac
BlackMac / post_parse.js
Created March 27, 2015 11:50
very basic post parser
parsePost = function(input) {
var result = {};
var parts = input.split("&");
parts.forEach(function(part) {
var divided = part.split("=");
result[divided[0]] = divided[1];
});
return result;
};
@BlackMac
BlackMac / trello_betterprint.css
Last active August 31, 2015 11:52
Better Trello print style for the most essential info on cards. Use https://chrome.google.com/webstore/detail/styler/bogdgcfoocbajfkjjolkmcdcnnellpkb to install
@media print {
body, html {
height:90% !important;
}
.window-module {
display: none;
}
.window-cover {
@BlackMac
BlackMac / test.js
Created April 24, 2012 10:06
Test # 140unichars
// #140unichars
function test() {}
@BlackMac
BlackMac / ctags_autocomplete.py
Created February 14, 2012 09:48
autocomplete over project for Sublime Text 2
# CTags based autocompletion plugin for Sublime Text 2
# You can add the file to the User Package in ~/Library/Application Support/Sublime Text 2/Packages and restart Sublime Text 2.
# generate the .tags file in your project root with "ctags -R -f .tags"
import sublime, sublime_plugin, os
class AutocompleteAll(sublime_plugin.EventListener):
def on_query_completions(self, view, prefix, locations):
tags_path = view.window().folders()[0]+"/.tags"
@BlackMac
BlackMac / accelerometer_processing.pde
Created November 24, 2011 22:16
Pololu MMA7341 and MMA7361 with Arduino - Processing
/**
This is my first ever processing script, so please fork and fix ;)
The check for valid data does not work very well ;)
*/
import processing.serial.*;
Serial myPort; // Create object from Serial class
String val; // Data received from the serial port
@BlackMac
BlackMac / accelerometer.pde
Created November 24, 2011 21:50
Pololu MMA7341 and MMA7361 with Arduino
/**
VCC is connected to 3.3V
Make sure to connect Test to 3.3V or you will get garbage data!
*/
#define XOUT A0
#define YOUT A1
#define ZOUT A2
void setup() {
@BlackMac
BlackMac / test.js
Created October 20, 2010 19:51
shared
//test
#!/bin/sh
cd /var/cache/git
mkdir "$1.git"
chmod 775 "$1.git"
cd "$1.git"
git init --bare
cd ..
chown -R root:git "$1.git"
UIImage *image=[UIImage imageNamed:@"navbar"];
self.navigationController.navigationBar.tintColor=[UIColor colorWithRed:0.37 green:0.54 blue:0.57 alpha:1];
self.navigationController.navigationBar.layer.contents=(id)image.CGImage;
Total 9 tests (Passed: 8; Fails: 1; Errors: 0) (3,00 ms)
Safari 528.16 iPhone OS: Run 3 tests (Passed: 3; Fails: 0; Errors 0) (2,00 ms)
Firefox 3.6 Mac OS: Run 3 tests (Passed: 2; Fails: 1; Errors 0) (2,00 ms)
DemoTest.testSafari failed (1,00 ms): devicePixelRatio expected not undefined but was undefined
()@http://127.0.0.1:4224/test//Users/stefan/Desktop/moonit/src/demo_tests.js:16
Safari 531.22.7 Mac OS: Run 3 tests (Passed: 3; Fails: 0; Errors 0) (3,00 ms)