This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// THis is for getting the search history on chrome | |
//Navigate to chrome://history/ | |
//Search for "google.com/search/?q=" in the search box | |
function writeChromeHistoryToFile(fileName) { | |
coln = document.getElementsByTagName("a") | |
data = [].slice.call(coln).map((x) => x.href) | |
if(typeof data === "object"){ | |
data = JSON.stringify(data, undefined, 4) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Async load items from a remote API | |
loadItemsInStore(collection) { | |
this.setState({ isFetchingItemsFromRemote: true}); | |
let promises = []; | |
for(let c of collection.values()) { | |
promises.push(ItemService.getItems(c.id)); | |
} | |
let allPromises = Promise.all(promises); | |
//Fulfill the Promise |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | |
<html lang="en"> | |
<head> | |
<title>Dashboard Example</title> | |
<style type="text/css"> | |
body, html { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; } | |
iframe { border: none; width: 100%; height: 100%; display: none; } | |
iframe.active { display: block;} | |
</style> | |
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example of webgl rendered with orbitcontrols | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Vorcel</title> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"> | |
<style> | |
body { | |
font-family: Monospace; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# usage ch-hadoop production|qa | |
cd /Users/yranadive/hadoop/etc/hadoop | |
if [ $1 = 'production' ] | |
then | |
rm core-site.xml | |
rm hdfs-site.xml | |
rm mapred-site.xml | |
rm yarn-site.xml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
execute pathogen#infect() | |
call pathogen#helptags() | |
filetype off | |
syntax on | |
filetype plugin indent on | |
map <C-n> :NERDTreeToggle<CR> | |
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
irb> require 'webhdfs' | |
irb> client = WebHDFS::Client.new('hadoop-nn', 50070) | |
irb> fl = client.list('/user/hive/warehouse/database.db/tablename/') | |
irb> DateTime.strptime(fl.collect {|x| x['modificationTime']}.max.to_s, '%M') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$:.push('/home/yranadive/gen-rb') | |
# This file monitors a set of storm topologies and generates | |
# 1. Zenoss friendly status message. e.g. topo1:1 topo2:0 (1=active, 0=inactive) | |
# 2. Mails the inactive topologies | |
# Usage: ruby storm_monitor.rb [mail] | |
# Optional argument "mail" on the command line will mail the report | |
require 'rubygems' | |
require 'thrift' | |
require 'nimbus' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Download Mixpanel Data | |
require '../lib/hive_utils.rb' | |
require 'yaml' | |
require 'fileutils' | |
require File.expand_path(File.dirname(__FILE__) + '/mixpanel_extract.rb') | |
# TODO use thor here to take the date from the commandline | |
def print_usage_and_exit | |
puts %q[Usage: |