Skip to content

Instantly share code, notes, and snippets.

View saranyan's full-sized avatar

Saranyan saranyan

View GitHub Profile
@saranyan
saranyan / bigcommerce_basic_sample.php
Created July 15, 2013 20:49
Bigcommerce sample code (PHP)
<?php
require 'bigcommerce.php';
use Bigcommerce\Api\Client as Bigcommerce;
error_reporting(E_ALL);
ini_set('display_errors', '1');
@saranyan
saranyan / stuff_of_R.R
Last active December 19, 2015 04:29
Some R commands along the way
#Read csv file into data
data <- read.csv("data.csv", header=TRUE)
#if data has a column called Temp with missing values, fill from prev (requires zoo package)
#install.packages("zoo")
data <- transform(data, Temp = na.locf(Temp))
#colnames of datatable
colnames(data)
# A Ruby implementation of
# the Viterbi algorithm based on the hidden Markov model (HMM)
#
# An original Python code: a Wikipedia page "Viterbi algorithm" at
# http://en.wikipedia.org/wiki/Viterbi_algorithm
#
# Author: MISHIMA, Hiroyuki
#
require 'pp'
@saranyan
saranyan / .Xdefaults
Created June 20, 2013 01:26
Xdefaults file - Solarized Theme + Bigger Font
!-------------------------------------------------------------------------------
! Xft settings
!-------------------------------------------------------------------------------
Xft.dpi: 96
Xft.antialias: false
Xft.rgba: rgb
Xft.hinting: true
Xft.hintstyle: hintslight
XTerm*font: *-fixed-*-*-*-20-*
@saranyan
saranyan / leap_script.js
Created May 29, 2013 12:01
Leap.JS + DOM Manipulation
//store frame for motion functions
var previousFrame;
var paused = false;
var pauseOnGesture = false;
var prevGestureID = 0;
//setup leap loop with frame callback function
var controllerOptions = {enableGestures: true};
Leap.loop(controllerOptions, function(frame){
@saranyan
saranyan / embedgist.js
Last active December 14, 2015 22:09 — forked from soemarko/theme.html
$(document).ready(function() {
$('.gist').each(function(i) {
writeCapture.html(this, '<script src="'+$(this).text()+'.js"></script>');
});
});
@saranyan
saranyan / sincerely_bc.rb
Created March 13, 2013 21:22
Sincerely API + Bigcommerce
require 'bigcommerce'
require 'json'
require 'rest-client'
require 'pp'
@saranyan
saranyan / bigcommerce_to_dropbox.rake
Last active December 14, 2015 21:59
Backing up Bigcommerce product images into dropbox
require 'bigcommerce'
require 'httparty'
require 'dropbox-api'
namespace :backups do
desc "Run a backup of all images"
task :run => :environment do
# let us setup a user with bcstore and dropbox creds
# this assumes that the user has allowed access to the dropbox application registered and in return,
When starting a project that includes refinerycms-blog:
$ rake refinery:override view=refinery/pages/*
$ rake refinery:override view=layouts/*
$ rake refinery:override view=refinery/blog/shared/*
$ rake refinery:override view=refinery/blog/posts/*
$ rake refinery:override view=refinery/*
$ rake refinery:override controller=refinery/blog/*
$ rake refinery:override controller=refinery/*