Skip to content

Instantly share code, notes, and snippets.

View searchs's full-sized avatar
💭
Architecting systems in a data world

Ola Ajibode searchs

💭
Architecting systems in a data world
View GitHub Profile
@searchs
searchs / talent_addy.js
Last active August 29, 2015 14:22
Contact module of Address book
var Contact = {};
Contact.parseName = function(str) {
return str.split(',')[0].trim()
};
Contact.parseNumber = function(str) {
return str.split(',')[1].trim()
var Parrot = require('./parrot')
console.log(Parrot.speakEnglish());
console.log(Parrot.speakSpanish());
var Contact = require('./contact')
console.log(Contact.parseName("John Smith,604-123-9090"))
console.log(Contact.parseNumber("John Smith,604-123-9090"))
@searchs
searchs / csvkit-sql-cli-readme.md
Created January 14, 2016 15:36 — forked from dannguyen/csvkit-sql-cli-readme.md
Using bash, csvkit, and SQLite to analyze San Francisco restaurant health inspection data

How to download, import, and analyze San Francisco restaurant inspection data using SQLite3 and csvkit from the command-line.

A quick example of doing data wrangling from the command-line, as well as getting to know one of San Francisco's data sets: the San Francisco restaurant inspections, courtesy of the SF Department of Public Health. I don't normally do database work from the command-line, but importing bulk data into SQLite is pretty frustrating using the available GUIs or just the shell.

So thank goodness for Christopher Groskopf's csvkit, a suite of Unix-like tools that use Python to robustly handle CSV files. There's a lot of great tools in csvkit, but for this gist, I just use csvsql, which can parse a CSV and turn it into properly-flavored SQL to pass directly into your database app of choice.

# Ask for the administrator password upfront
sudo -v
mkdir -p /Volumes/Sites/Work/Clients
mkdir -p /Volumes/Sites/Work/Internal
mkdir -p /Volumes/Sites/Personal
mkdir -p ~/Downloads/Torrents
xcode-select --install
@searchs
searchs / CreditCardNumberGenerator.java
Created January 27, 2016 14:27 — forked from josefeg/CreditCardNumberGenerator.java
Credit card number generator in Java
import java.util.Random;
/**
* A credit card number generator.
*
* @author Josef Galea
*/
public class CreditCardNumberGenerator {
private Random random = new Random(System.currentTimeMillis());
@searchs
searchs / Preferences.sublime-settings
Created June 7, 2016 16:00 — forked from abnersajr/Preferences.sublime-settings
Sublime Text 3 user settings
{
"always_show_minimap_viewport": false,
"bold_folder_labels": true,
"caret_extra_bottom": 2,
"caret_extra_top": 2,
"caret_extra_width": 3,
"caret_style": "phase",
"color_scheme": "Packages/Theme - Cobalt2/cobalt2.tmTheme",
"fade_fold_buttons": false,
"find_selected_text": true,
@searchs
searchs / definition.rb
Created June 21, 2016 13:34 — forked from zhengjia/definition.rb
Vagrant box with 'ubuntu' as the default user
# modify from veewee
require 'digest/md5'
CURRENT_DIR = File.dirname(__FILE__)
PRESEED_MD5 = "#{Digest::MD5.file("#{CURRENT_DIR}/preseed.cfg").hexdigest}"
Veewee::Session.declare( {
:boot_cmd_sequence => [
"<Esc><Esc><Enter>",
"/install/vmlinuz ",
"noapic ",
@searchs
searchs / hive_to_csv.md
Created October 25, 2016 16:29 — forked from alex9311/hive_to_csv.md
bash script to convert segmented hive table to single csv

###Hive Default Delimiters to CSV #####Reasoning Hive's default delimiters are

Row Delimiter => Control-A ('\001')
Collection Item Delimiter => Control-B ('\002')
Map Key Delimiter => Control-C ('\003')
@searchs
searchs / boto3_hands_on.md
Created November 10, 2016 17:15 — forked from iMilnb/boto3_hands_on.md
Programmatically manipulate AWS resources with boto3 - a quick hands on

boto3 quick hands-on

This documentation aims at being a quick-straight-to-the-point-hands-on AWS resources manipulation with [boto3][0].

First of all, you'll need to install [boto3][0]. Installing it along with [awscli][1] is probably a good idea as

  • [awscli][1] is boto-based
  • [awscli][1] usage is really close to boto's
@searchs
searchs / elk_stack_install.md
Created December 14, 2016 17:25 — forked from squarism/elk_stack_install.md
Quick Elasticsearch / Kibana / Logstash (ELK stack) Install (for your local mac dev box)

Elasticsearch / Kibana / Logstash Quick Install

Instructions for getting an ELK stack set up quick on Mac. Paths are opinionated. You'll have to infer and change. Sorry mate. 🍰

Install Homebrew if not already. You probably have. If not, you should.

brew install elasticsearch nginx

do yourself a favor and get a better services command than launchctl