This file contains 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
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 |
This file contains 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
#!/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 | |
# |
This file contains 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
// ==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++) { |
This file contains 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
package nfstest; | |
import com.sun.xfile.XFile; | |
/** | |
* Using YANFS | |
* | |
*/ | |
public class Main { |
This file contains 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
<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"; |
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.
This file contains 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
#!/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' |
This file contains 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 | |
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 | |
} |
OlderNewer