Skip to content

Instantly share code, notes, and snippets.

@SantoshSrinivas79
SantoshSrinivas79 / vim.rb
Last active August 29, 2015 13:57 — forked from mgrouchy/vim.rb
require 'formula'
class Vim < Formula
homepage 'http://www.vim.org/'
url 'https://vim.googlecode.com/hg/', :revision => '10d35c8b50e3'
version '7.4'
def features; %w(tiny small normal big huge) end
def interp; %w(lua mzscheme perl python python3 tcl ruby) end
@SantoshSrinivas79
SantoshSrinivas79 / 0_reuse_code.js
Last active August 29, 2015 14:14
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
start on filesystem and started networking
stop on shutdown
author "Santosh Srinivas"
description "Ghost Upstart Job for Thoughts instance"
version "0.1"
respawn
respawn limit 5 30
App.Tax = Ember.Object.extend({});
App.taxesController = Ember.ArrayController.create({
content: [
{name:"tax1",rate:"10",number_id:"TaxIDNum"},
{name:"tax2",rate:"9",number_id:null}
],
newTax: function() {
this.pushObject(App.Tax.create({}));
},
@SantoshSrinivas79
SantoshSrinivas79 / Heatmap.R
Created September 28, 2012 05:21 — forked from dsparks/Heatmap.R
ggplot2 heatmap with "spectral" palette
# Simple ggplot2 heatmap
# with colorBrewer "spectral" palette
doInstall <- FALSE # Change to FALSE if you don't want packages installed.
toInstall <- c("ggplot2", "reshape2", "RColorBrewer")
if(doInstall){install.packages(toInstall, repos = "http://cran.us.r-project.org")}
lapply(toInstall, library, character.only = TRUE)
# Generate a random matrix
# This can be any type of numeric matrix,
@SantoshSrinivas79
SantoshSrinivas79 / chartTimeSeries and chartsPerformanceSummary.r
Created November 3, 2012 08:41 — forked from timelyportfolio/chartTimeSeries and chartsPerformanceSummary.r
plot.xts replacements of PerformanceAnalytics chart.TimeSeries and charts.PerformanceSummary
#install.packages("xtsExtra", repos="http://R-Forge.R-project.org")
require(PerformanceAnalytics)
require(xtsExtra) #if you get error, please install xtsExtra from r-forge as shown in the top line
#replicate example provided in chart.TimeSeries with plot.xts
# These are start and end dates, formatted as xts ranges.
## http://www.nber.org-cycles.html
cycles.begin.dates<-c("1857-06",
@SantoshSrinivas79
SantoshSrinivas79 / gist:4024730
Created November 6, 2012 13:26 — forked from kafka399/gist:2479226
rsi blotter
rsi2Vix<-function(ticker,vix)
{
getSymbols(c('SPY','VIX'),from='1995-01-01',index.class=c("POSIXt","POSIXct"))
rsi2<-RSI(Cl(SPY),2)
signal<-ifelse(rsi2>90,-1,0)
temp<-ifelse(rsi2<10,1,0)
@SantoshSrinivas79
SantoshSrinivas79 / Spot the Hijack
Created October 18, 2015 16:51 — forked from iolloyd/Spot the Hijack
Use Audio Hijack Pro to record Spotify tracks while you listen
* Script to record and tag spotify tracks, by Lloyd Moore *)
(* Make sure you are already recording in Audio Hijack Pro with a session called 'spotifySession' *)
tell application "Spotify"
set currentTrack to (current track)
set trackName to (name of currentTrack)
tell application "Audio Hijack Pro"
set theSession to my getSession()
end tell
repeat
/*
* Takes provided URL passed as argument and make screenshots of this page with several viewport sizes.
* These viewport sizes are arbitrary, taken from iPhone & iPad specs, modify the array as needed
*
* Usage:
* $ casperjs screenshots.js http://example.com
*/
var casper = require("casper").create();
# Drawing a scatter plot of raster images
doInstall <- TRUE # Change to FALSE if you don't want packages installed.
toInstall <- c("png", "sna")
if(doInstall){install.packages(toInstall, repos = "http://cran.r-project.org")}
lapply(toInstall, library, character.only = TRUE)
# Go to https://www.gosquared.com/resources/2400-flags, download the ZIP,
# and put the 64 x 64 files into a directory of your choosing.
# Then setwd() to that directory:
setwd("C:/Dropbox/isDotR_Files/flagIcons")