Skip to content

Instantly share code, notes, and snippets.

View rogeruiz's full-sized avatar

Roger Steve Ruiz rogeruiz

View GitHub Profile
@kosamari
kosamari / _.R.js
Last active December 7, 2018 11:12
Underscore mixin to enable core R functions
_.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);
},
@toolness
toolness / docker-thoughts.md
Last active March 26, 2019 15:21
Reflections on Docker-based development

Reflections on Docker-based development

Note that these reflections are specifically tailored to a conversation about Docker we're having at 18F, and as such they have a few assumptions:

Advantages

@huzairyworks
huzairyworks / tiny_letter_mod.php
Created August 9, 2011 13:58
TinyLetter embed code
<form action="http://tinyletter.com/mohdhuzairy" method="post" target="popupwindow" onsubmit="window.open('http://tinyletter.com/mohdhuzairy', 'popupwindow', 'scrollbars=yes,width=800,height=600');return true"><p><input type="text" name="emailaddress" value="Masukkan emel anda" onfocus="if (this.value == 'Masukkan emel anda') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Masukkan emel anda';}" /></p><input type="hidden" value="1" name="embed"/><input type="submit" value="Subscribe" /><p>Powered by <a href="http://tinyletter.com"> TinyLetter</a></p></form>
@bbest
bbest / .block
Last active January 7, 2020 14:47
Aster Plot in D3
license: mit
height: 300
scrolling: no
border: no
@snaga
snaga / gist:7495184
Created November 16, 2013 02:35
postgresql.conf @ RDS for PostgreSQL
testdb=> SELECT name,setting,unit FROM pg_settings;
name | setting | unit
---------------------------------+---------------------------------------------+------
allow_system_table_mods | off |
application_name | psql |
archive_command | /etc/rds/dbbin/pgscripts/rds_wal_archive %p |
archive_mode | on |
archive_timeout | 300 | s
array_nulls | on |
authentication_timeout | 60 | s
@exAspArk
exAspArk / friday_deploy_cap2.rb
Last active November 14, 2020 23:13
Friday deploy script for Capistrano
# Capistrano 2
before "deploy", "friday:good_luck"
namespace :friday do
friday_jumper = %{
┓┏┓┏┓┃
┛┗┛┗┛┃⟍ ○⟋
┓┏┓┏┓┃ ∕ Friday
┛┗┛┗┛┃ノ)
@pkarman
pkarman / github-team-norms-template.md
Last active August 21, 2021 00:04
Team norms for projects that use GitHub

Norms for teams that use GitHub

This template is designed as a list of examples, questions and/or prompts for teams to discuss as they build norms around using GitHub.

Repo layout

We prefer a directory layout that looks like:

  • README.md
  • CONTRIBUTING.md
@rogeruiz
rogeruiz / vim-everywhere-or-how-i-abstracted-away-my-workflow-and-cant-use-regular-computers-anymore.markdown
Last active September 10, 2021 19:36
18F Tech Talk Lite! 2017: How to Vim Everywhere. Or, how I abstracted away my workflow and can't use regular computers anymore

Preface

Hey there folks, I'm Roger and I use the terminal for just about everything text related. I really like using a keyboard over a mouse.

Let's begin our journey into my workflow with two things in mind. First off, there is very little research here in terms of actual productivity gains. I did this mostly for fun.

This is just how one person decided to hit the dopamine part of their brain

@dhoelzgen
dhoelzgen / base_controller.rb
Last active October 7, 2021 16:19
CORS in Rails 4 APIs
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'