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
ssh-keygen -t rsa -b 2048 -v | |
cat server.pub >> .ssh/authorized_keys | |
# rename server server.pem | |
# Distribute server.pem to login. |
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
const gcloud = require('gcloud'); | |
const _ = require('lodash'); | |
const cache = require('./cache'); | |
const log = console.log; | |
const config = {projectId: process.env.GCLOUD_PROJECT || 'brydge-api'} | |
const ds = gcloud.datastore(config); | |
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
1. In mix.exs, create | |
defp package do | |
[ | |
files: ["lib", "mix.exs", "README", "LICENSE*"], | |
maintainers: ["Your Name"], | |
licenses: ["Apache 2.0"], | |
links: %{"GitHub" => "https://github.com/fteem/some_app_name"} | |
] |
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
This is all you need to know about Clojure’s namespace declarations: | |
(ns my-project.core | |
; :require Clojure libs | |
(:require clojure.core.async | |
[compojure.core :refer [POST routes]] | |
[compojure.handler :refer :all] | |
[ring.adapter.jetty :as jetty] | |
[clojure.edn :as edn :refer [read]]) | |
; :import for Java classes |
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
#http://durdn.com/blog/2012/11/22/must-have-git-aliases-advanced-examples/ | |
[alias] | |
co = checkout | |
br = branch | |
ci = commit | |
st = status | |
last = log -1 HEAD | |
visual = !gitk | |
l = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate |
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
(ns haze-api.core | |
(:require [net.cgrand.enlive-html :as html]) | |
(:gen-class)) | |
(def doe-url "http://apims.doe.gov.my/apims/hourly2.php") | |
(defn rows-by-enlive | |
[url] | |
(let [site (html/html-resource (java.net.URL. url)) | |
rows (html/select site [:table.table1 :tr])] |
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
import org.jsoup.* | |
String URL = "http://apims.doe.gov.my/apims/hourly2.php" | |
def doc = Jsoup.connect(URL).get(); | |
def result = doc.select("table.table1 tr"); | |
result.each { tr -> | |
def row = tr.select("td") | |
println " ---- row---\n" + row[0].text() + " " + row[1].text() |
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
[alias] | |
co = checkout | |
ci = commit | |
st = status | |
br = branch | |
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short | |
type = cat-file -t | |
l = log --oneline --decorate | |
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat | |
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate |
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
require 'formula' | |
class ScalaDocs < Formula | |
homepage 'http://www.scala-lang.org/' | |
url 'http://www.scala-lang.org/downloads/distrib/files/scala-2.9.1.final-devel-docs.tgz' | |
version '2.9.1' | |
md5 'acb16cbdf46f682806f60b052707b7b7' | |
end | |
class Scala < Formula |
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
/** E.g., UIColorFromRGB(0xE5E5E5) */ | |
#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0] |