Skip to content

Instantly share code, notes, and snippets.

View arun057's full-sized avatar

Arunram Kalaiselvan arun057

  • PlaceIQ
  • New York, NY
View GitHub Profile
@tarlepp
tarlepp / BaseController.js
Last active October 22, 2015 04:32
Generic count method
/**
* api/services/BaseController.js
*
* Base controller for all sails.js controllers. This just contains some common code
* that every controller uses
*/
'use strict';
var actionUtil = require('sails/lib/hooks/blueprints/actionUtil');
@roolo
roolo / mysql2-gem-install.sh
Last active December 25, 2018 07:43
Fixing "Incorrect MySQL client library version! This gem was compiled for 5.5.29 but the client library is 5.6.10. (RuntimeError)" on OS X while using Brew
ARCHFLAGS="-arch x86_64" gem install mysql2 -- –with-mysql-config=/usr/local/bin/mysql_config
@ndarville
ndarville / business-models.md
Last active October 23, 2024 17:18
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@ksykulev
ksykulev / gist:4046807
Created November 9, 2012 16:52
Create an absolutely positioned div that auto overflows if screen gets smaller but doesn't expand past the height of the content
<!DOCTYPE html>
<html>
<head>
<style>
html, body { margin:0px;padding:0px;height:100%;width:100%; }
#left-side { float:left;background-color:#E5EBF2;width:25%;border-right: 1px solid #B4B4B4;height:100%; }
#right-side { float:left;position:relative;height:100%;width:70%; }
#floater { background-color:lightgray;position:absolute;padding:5px;width:365px;top:20px;left:-15px;-moz-box-shadow: 0 4px 8px rgba(0,0,0,0.6);-webkit-box-shadow: 0 4px 8px rgba(0,0,0,0.6);-o-box-shadow: 0 4px 8px rgba(0,0,0,0.6);box-shadow: 0 4px 8px rgba(0,0,0,0.6); }
/*the `magic`*/
#floater { overflow-y:auto;height:auto;max-height:90%; }
@dhavaln
dhavaln / filesystem.js
Created June 8, 2012 08:51
PhoneGap Filesystem Example
/**
* Prepare the App Folder
*/
(function(){
window.appRootDirName = ".myapp";
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log("device is ready");
window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem;
@katta
katta / mvncolor.sh
Created June 15, 2011 18:50
Script to add colors to maven output
#!/usr/bin/env bash
# Formatting constants
export BOLD=`tput bold`
export UNDERLINE_ON=`tput smul`
export UNDERLINE_OFF=`tput rmul`
export TEXT_BLACK=`tput setaf 0`
export TEXT_RED=`tput setaf 1`
export TEXT_GREEN=`tput setaf 2`
export TEXT_YELLOW=`tput setaf 3`