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
CREATE OR REPLACE FUNCTION "ORACLEGIT"."F" return varchar as | |
begin | |
return | |
'Hello world'; | |
end; |
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/sh | |
# a quick & dirty script to create a TinyCore initrd (for Core >= 4.2) | |
H=$( pwd ) | |
M=$( mount | grep iso9660 | head -1 | awk '{print $3}' ) | |
[ -z "$M" ] && echo "can not find mounted CD-ROM" && exit 1 | |
D=$( mktemp -d ) |
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/sh | |
# blog post: http://www.sitepoint.com/one-click-app-deployment-server-side-git-hooks/ | |
## store the arguments given to the script | |
read oldrev newrev refname | |
## Where to store the log information about the updates | |
LOGFILE=./post-receive.log | |
# The deployed directory (the running site) | |
DEPLOYDIR=/var/www/html/simpleapp |
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
# array | |
>>> [1] | |
[1] | |
>>> [1,] | |
[1] | |
# hash | |
>>> {'a':1} | |
{'a': 1} | |
>>> {'a':1,} |
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
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Description": "Building a VPC from scratch with CloudFormation", | |
"Mappings": { | |
"SubnetConfig": { | |
"VPC": { "CIDR": "10.0.0.0/16" }, | |
"Public": { "CIDR": "10.0.0.0/24" } | |
}, | |
"RegionMap" : { |
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.apache.commons.codec.digest.DigestUtils; | |
public class GitSha1 { | |
public static String githash(String aString){ | |
return DigestUtils.sha1Hex("blob " + aString.length() + "\0" + aString); | |
} | |
public static void main(String[] args) { |
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 | |
;; the nth element of the series | |
(defn pi-series [n] | |
(/ (* 4 (Math/pow -1 n)) (inc (* 2 n)))) | |
;; lazy sequence giving the individual terms | |
(def pi1 (map #(pi-series %) (iterate inc 0))) | |
;; basically the same, but will use fractions (slower, but nice to look at) | |
(def pi2 (map #(/ (* 4 (expt -1 %)) (+ (* 2 %) 1)) (iterate inc 0))) |
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
;;; all code in this function lifted from the clojure-mode function | |
;;; from clojure-mode.el | |
(defun clojure-font-lock-setup () | |
(interactive) | |
(set (make-local-variable 'lisp-indent-function) | |
'clojure-indent-function) | |
(set (make-local-variable 'lisp-doc-string-elt-property) | |
'clojure-doc-string-elt) | |
(set (make-local-variable 'font-lock-multiline) t) |
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 daft | |
(meta {:description "The song 'Around the World' by Daft Punk has a deeply repetitive nature, unfortunately the lyrics is oftent stated wrong. | |
The song has 4 verses consisting of 8, 16, 28 and 20 double repetitions of the phrase 'Around the world'. | |
All in all, the song has 72 double repetitions or 144 repetitions of the iconic phrase."})) | |
(def lyrics (repeat "Around the world, around the world")) | |
(defn sing [lyrics] | |
(reduce str | |
(interleave |
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 | |
semaphore() { | |
if [ -e $0.pid ]; then | |
PID=$(cat $0.pid) | |
fi | |
if [ $PID ]; then | |
echo $PID on file | |
PIDr=$( ps -ef | awk '{print $2}' | grep ^$PID$ ) |
OlderNewer