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
public class HelloWorld { | |
public static void main (String[] args) { | |
System.out.println("Hello, World!"); | |
} | |
} |
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
(defn persistent-hash-map [k v] | |
"Create PeristentHashMap - performs faster for larger maps" | |
(hash-map k v)) | |
(type (persistent-hash-map :a 1)) | |
(defn persisten-array-map [k v] | |
"Create PeristentArrayMap - only suitable for very small maps" | |
{k v}) | |
(type (persisten-array-map :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
(function () { | |
d3.analog= function() { | |
var height = 200, gap=10, | |
xValue = function(d) { return d[0]; }, | |
xScale = null, | |
color = d3.scale.category10(); | |
function chart(selection) { | |
selection.each(function(d) { | |
var g = d3.select(this); |
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 gist.conduit | |
(:require [net.cgrand.enlive-html :as html] | |
[net.cgrand.tagsoup :as tagsoup])) | |
; The implementations of conduit and defconduit are modified versions of | |
; the macros template and deftemplate from the guts of Enlive. | |
; They're named 'conduit' because the selectors and transformations serve as a | |
; channel between the scaffold of HTML and some data provided as an argument. |
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
(defun test-internet () | |
(remove-if (lambda (el) | |
(string-match-p "lo.*" (car el))) | |
(network-interface-list))) | |
(test-internet) | |
(defun tzz-has-network () | |
(remove-if (lambda (i) | |
(or (string-match-p "\\(vboxnet\\|docker\\).*" 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
(loop [r 0 | |
break false] | |
(if-not break | |
(if (< r 5) | |
(do | |
(println "Expensive calculation of r:" r) | |
(recur (inc r) false)) | |
(do | |
(println "Breaking the loop at:" r) | |
(recur r true))))) |
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
;;; cobol-mode.el --- Mode for editing COBOL code -*- lexical-binding: t; -*- | |
;; Copyright (C) 2013-2015 Edward Hart | |
;; Author: Edward Hart <edward.dan.hart@gmail.com> | |
;; Maintainer: Edward Hart | |
;; Version: 0 | |
;; Created: 9 November 2013 | |
;; Keywords: languages |
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 bash | |
# Debugging | |
# set -x | |
# Stop on error | |
set -e | |
# Exit if variables are not set (recommended) | |
set –u | |
logfile=file.log |
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 bash | |
# get all the PPAs installed on a system ready to share for reininstall | |
for APT in `find /etc/apt/ -name \*.list`; do | |
# list found files - helps in case of: '... public key is not available: NO_PUBKEY' | |
echo $APT | |
grep -o "^deb http://ppa.launchpad.net/[a-z0-9\-]\+/[a-z0-9\-]\+" $APT | while read ENTRY ; do | |
USER=`echo $ENTRY | cut -d/ -f4` | |
PPA=`echo $ENTRY | cut -d/ -f5` | |
echo sudo apt-add-repository ppa:$USER/$PPA |
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 bash | |
# Debugging | |
# set -x | |
# Stop on error | |
set -e | |
# Exit if variables are not set (recommended) | |
set –u | |
tstp() { |
OlderNewer