Skip to content

Instantly share code, notes, and snippets.

View electrum's full-sized avatar
🚀
Working on @trinodb at @starburstdata

David Phillips electrum

🚀
Working on @trinodb at @starburstdata
View GitHub Profile
class Video < ActiveRecord::Base
has_many :video_locations
has_many :locations, :through => :video_locations
accepts_nested_attributes_for :locations
has_many :video_people
has_many :people, :through => :video_people
attr_accessible :title, :date, :url
validates_presence_of :title, :date, :url
@jvanzyl
jvanzyl / hack.sh
Created March 31, 2012 14:28 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@electrum
electrum / javadoc.user.js
Created August 21, 2012 22:54
Latest Javadoc Redirect
// ==UserScript==
// @name Latest Javadoc Redirect
// @match http://docs.oracle.com/javase/*/api/*
// ==/UserScript==
(function() {
var oldVersions = ['1.3', '1.4.2', '1.5.0', '1,5.0', '6'];
var newVersion = '7';
var url = window.location.toString();
for (var i = 0; i < oldVersions.length; i++) {
@krujos
krujos / yanfs example
Created February 2, 2015 20:36
Java NFS client
package nfstest;
import com.sun.xfile.XFile;
/**
* Using YANFS
*
*/
public class Main {
@jasonLaster
jasonLaster / ConsoleTricks.html
Created February 27, 2011 21:47
WebKit Console tricks adapted from CSS Ninja's excellent tutorial http://bit.ly/fi4lnK
<html>
<body>
<script type="text/javascript" charset="utf-8">
// CONSOLE log
var foo = {baz: "tubular", goo: "rad"}, bar = "baz";
console.log("string",1,foo.goo,bar,foo.baz); // string 1 rad baz tubular
console.log(foo)
// CONSOLE Printf
var foo = {baz: "tubular", goo: "rad"}, bar = "baz";

Presto connector development 1

One of the very good design decisions Presto designers made is that it's loosely coupled from storages.

Presto is a distributed SQL executor engine, and doesn't manager schema or metadata of tables by itself. It doesn't manage read data from storage by itself. Those businesses are done by plugins called Connector. Presto comes with Hive connector built-in, which connects Hive's metastore and HDFS to Presto.

We can connect any storages into Presto by writing connector plugins.

Plugin Architecture

@rcoup
rcoup / aws_usage.py
Created June 1, 2010 21:46
A script to query the Amazon Web Services (S3/EC2/etc) usage reports programmatically.
#!/usr/bin/env python
"""
A script to query the Amazon Web Services usage reports programmatically.
Ideally this wouldn't exist, and Amazon would provide an API we can use
instead, but hey - that's life.
Basically takes your AWS account username and password, logs into the
website as you, and grabs the data out. Always gets the 'All Usage Types'
#!/bin/bash
function setjdk {
local ver=${1?Usage: setjdk <version>}
export JAVA_HOME=$(/usr/libexec/java_home -v $ver)
PATH=$(echo $PATH | tr ':' '\n' | grep -v Java | tr '\n' ':')
export PATH=$JAVA_HOME/bin:$PATH
}
@electrum
electrum / README.md
Last active June 2, 2020 12:04
Git Scripts

Install the following programs and configure them with permissions to access your GitHub profile:

These scripts assume the following two remotes exist:

  • origin: your fork
  • upstream: the upstream repository