A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
class API::V1::BaseController < ApplicationController | |
skip_before_filter :verify_authenticity_token | |
before_filter :cors_preflight_check | |
after_filter :cors_set_access_control_headers | |
def cors_set_access_control_headers | |
headers['Access-Control-Allow-Origin'] = '*' | |
headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS' |
A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
This is a guide on how to email securely.
There are many guides on how to install and use PGP to encrypt email. This is not one of them. This is a guide on secure communication using email with PGP encryption. If you are not familiar with PGP, please read another guide first. If you are comfortable using PGP to encrypt and decrypt emails, this guide will raise your security to the next level.
license: mit | |
height: 300 | |
scrolling: no | |
border: no |
_.mixin({ | |
sum : function(data){ | |
return _.reduce(data, function(memo, num){ return memo + num; }, 0); | |
}, | |
mean : function(data){ | |
return this.sum(data)/data.length | |
}, | |
median : function(data){ | |
return this.percentile(data,50); | |
}, |
# Capistrano 2 | |
before "deploy", "friday:good_luck" | |
namespace :friday do | |
friday_jumper = %{ | |
┓┏┓┏┓┃ | |
┛┗┛┗┛┃⟍ ○⟋ | |
┓┏┓┏┓┃ ∕ Friday | |
┛┗┛┗┛┃ノ) |
{ | |
// http://eslint.org/docs/rules/ | |
"ecmaFeatures": { | |
"binaryLiterals": false, // enable binary literals | |
"blockBindings": false, // enable let and const (aka block bindings) | |
"defaultParams": false, // enable default function parameters | |
"forOf": false, // enable for-of loops | |
"generators": false, // enable generators | |
"objectLiteralComputedProperties": false, // enable computed object literal property names |
#!/bin/bash | |
# README | |
# Requires ffpmeg to be installed with some extra dependencies. I used the following | |
# brew install command and so can you. | |
# `brew install ffmpeg brew reinstall ffmpeg --with-theora --with-libvorbis --with-libvpx` | |
# Input name should be the path to your actual file including the extension. | |
INPUT_FILE_NAME=$1; | |
# Output name should be just the name of the output files without an extension. |
// Just a sketch - this API isn't implemented (yet) | |
// Common base class shared by all plugins | |
var makePlugin = require('broccoli-plugin') | |
var mergeTrees = makePlugin({ | |
init: function(inputTrees, options) { | |
// You can define this function with any parameters you like; inputTrees | |
// and options are merely conventional. All arguments will be passed | |
// through from the plugin constructor. |