Skip to content

Instantly share code, notes, and snippets.

@creativepsyco
creativepsyco / .mozconfig
Created February 21, 2012 17:21
mozconfig for mac os x 10.7
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-TB
mk_add_options AUTOCONF=/usr/local/Cellar/autoconf213/2.13/bin/autoconf213
# -s makes builds quieter by default
# -j4 allows 4 tasks to run in parallel. Set the number to be the amount of
# cores in your machine. 4 is a good number.
ac_add_options --enable-calendar
# Enable debug builds
#ac_add_options --enable-debug
@creativepsyco
creativepsyco / post-curl
Created March 5, 2012 18:02
POST request Via CURL in MAC OS X
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"userid": "mohit", "password":"password"}' http://mmedwebdemo.ddns.comp.nus.edu.sg:8080/comp.nuhs.jaxb/api/usr/login
" ir_black color scheme
" More at: http://blog.infinitered.com
" ********************************************************************************
" Standard colors used in all ir_black themes:
" Note, x:x:x are RGB values
"
" normal: #f6f3e8
"
@creativepsyco
creativepsyco / phonegap_imgur_uploader.js
Created June 25, 2012 00:46
Imgur + Phonegap image uploader
// Author: creativepsyco
// More info here; http://api.imgur.com/resources_anon
// Allows only 50 uploads per client.
// GLOBAL VARS
var API_KEY = "YOUR_API_KEY"; // Developer key for imgur
var pictureSource = null;
var destinationType = null;
// Only png and jpg files are supported
// image data should be in base64 encoded stream
//
@creativepsyco
creativepsyco / sample-usage.html
Created June 25, 2012 02:11
Sample usage of phonegap+imgur uploader.js
<script type="text/javascript">
var pic_callback = function(image_data, message) {
if(message.length>1) {alert("Image selected ");}
var upload_callback = function(url, msg) {
if(url == null || url== undefined || url.length<1) {
alert("Failed to upload" + msg);
} else {
alert("Img Url " + url)
}
@creativepsyco
creativepsyco / offline_storage.js
Created October 9, 2012 20:30
Sample usage of HTML5 Storage
// Author: Mohit (msk)
//
// Prototype singleton class
//
var OfflineStorageAPI = {
// Cordova is ready
// Initialize the Database
isDebug: false,
getValueForKey: function(key) {
@creativepsyco
creativepsyco / paging.js
Created October 10, 2012 20:44
Replace tabzine_page by the class of the page element
/**
* [PageControl: does page related magic for tabzine_page class divs]
* @type {Object}
*/
var PageControl = {
currentPage : 1,
totalPages: 1,
/* install connect first */
// npm install connect
var connect = require('connect');
connect.createServer(
connect.static(__dirname)
).listen(8080);
@creativepsyco
creativepsyco / WizardBackbone.js
Created October 21, 2012 15:23
A wizard like flow for Backbone.js Views
define(['jquery',
'underscore',
'backbone',
'jquerym',
'text!templates/pointer/new.html',
'text!templates/pointer/postPointer/step1.html',
'text!templates/pointer/postPointer/step2.html'],
function($, _, Backbone,
jquerym,
postMapPointerTemplate,
@creativepsyco
creativepsyco / style.css
Created November 1, 2012 16:31
stylesheet-expressjs
/* general */
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
body {
font: 400 14px/1.6 "Open Sans", sans-serif;