Skip to content

Instantly share code, notes, and snippets.

View vfulco's full-sized avatar

Vincent C Fulco vfulco

  • Weisisheng Corporate Management Consulting (Shanghai) Ltd.
  • Shanghai, China
View GitHub Profile
@vfulco
vfulco / RV vs FV
Last active August 29, 2015 14:09 — forked from mbusigin/RV vs FV
getSymbols("^GSPC", from="1950-01-01")
p = 10
a = na.omit(merge( volatility(GSPC, n=p)*100, lag(volatility(GSPC, n=p), k=-p)*100 ))
names(a) = c("hv", "rv")
medianvalues = c()
meanvalues = c()
maxvalues = c()
minvalues = c()
keys = c()
for ( x in seq( 0, max(a$hv), 2 ) )
@vfulco
vfulco / llxc.R
Last active August 29, 2015 14:09 — forked from mbusigin/llxc.R
llxc = function( a, ll=-12:12, legend.loc="topleft", displayLegend=T, legend.cex=1.0, overplot=F )
{
if ( ncol(a) < 2 )
{
print( "Not enough columns")
return;
}
a = na.omit(a)
@vfulco
vfulco / r-pkgs.md
Last active August 29, 2015 14:24 — forked from peterhurford/r-pkgs.md

Notes from reading through R Packages by Hadley Wickham. This is meant to review, not replace, a thorough readthrough. I mainly wrote this as a personal review, since writing summaries and attempting to teach others are some of the best ways to learn things.

Introduction

  • Packages are used to organize code together so that it can be used repeatedly and shared with others.

  • A lot of work with packages is done via the devtools package.

@vfulco
vfulco / Contract Killer 3.md
Last active August 29, 2015 14:26 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

@vfulco
vfulco / .gitignore
Last active August 29, 2015 14:27 — forked from mchelen/.gitignore
jsonresume registry server ubuntu 14.04
*~
registry-server/
.vagrant/
@vfulco
vfulco / dokku_stackscript.sh
Last active September 1, 2015 15:40 — forked from turley/dokku_stackscript.sh
Linode StackScript for creating a Dokku server
#!/bin/bash
# <UDF name="hostname" label="The hostname for the new Linode" example="apps">
# <UDF name="fqdn" label="The new Linode's Fully Qualified Domain Name" example="apps.example.com">
# <UDF name="adminuser" label="Username for new admin user (cannot be dokku)">
# <UDF name="adminpass" label="Password for new admin user">
# <UDF name="adminkey" label="SSH public key authorized for admin user (password SSH auth will be disabled)">
# <UDF name="dokkukey" label="SSH public key authorized for dokku user (used when deploying apps)">
# Turn off password authentication and root login for SSH
@vfulco
vfulco / config.py
Last active September 20, 2015 09:32 — forked from klinkin/config.py
Using mandrill (mailchimp) service to send emails
from application.mail import mail_send
...
SECURITY_SEND_MAIL_FUNCTION = mail_send
...
FROM_EMAIL = 'dispatch@site.ru'
FROM_NAME = u'Site Admin'
@vfulco
vfulco / InstallationStack.md
Last active September 22, 2015 03:57 — forked from pjnovas/InstallationStack.md
Complete Install on Ubuntu Server of Nodejs + MongoDB + NGINX

##Ubuntu Server

NodeJS

sudo apt-get install g++ curl libssl-dev apache2-utils git-core make
cd /usr/local/src
wget http://nodejs.org/dist/v0.10.28/node-v0.10.28.tar.gz
tar -xvzf node-v0.10.28.tar.gz
cd node-v0.10.28
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
@vfulco
vfulco / import_json_appsscript.js
Created October 8, 2015 10:22 — forked from chrislkeller/import_json_appsscript.js
Adds what amounts to an =ImportJSON() function to a Google spreadsheet... To use go to Tools --> Script Editor and add the script and save.
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();