Skip to content

Instantly share code, notes, and snippets.

ips = Array.new
ips.push '192.168.13.201'
ips.push '192.168.13.202'
ips.push '192.168.13.206'
ips.push '192.168.13.205'
ips.push '192.168.13.211'
ips.push '192.168.13.209'
ips.push '192.168.13.210'
ips.push '192.168.13.217'
ips.push '192.168.13.216'
@gzmask
gzmask / file_Read.go
Created February 25, 2010 16:19
golang strange syntax errors
package main
import "fmt"
import "os"
func main() {
file, _ := os.Open("list.txt", os.O_RDWR, 0644)
var b [40000] byte
file.Read(&b)
fmt.Print(len(&b))
@gzmask
gzmask / Each.go
Created February 25, 2010 20:59 — forked from divoxx/gist:315024
each function
package main;
import "fmt"
func Each(arr []int, iterator func(int)) {
for i := range arr {
iterator(i)
}
}
@gzmask
gzmask / Chrome.html
Created February 25, 2010 15:29
Chrome src vs firefox src
<html>
<head>
<title></title>
<style type="text/css">
<!--
.Style1 {
font-family: "Courier New", Courier, mono;
font-size: small;
}
-->
@gzmask
gzmask / change.clj
Last active August 29, 2015 14:07
Counting Change Combinations codewars
(ns count-change)
(defn cart [colls]
(if (empty? colls)
'(())
(for [x (first colls)
more (cart (rest colls))]
(cons x more))))
(defn noseq? [x]
@gzmask
gzmask / nim.clj
Last active August 29, 2015 14:07
nim codewar
(ns nim)
(defn nim-sum [state]
(apply bit-xor state))
(defn next-move [[i k] state]
(cond
(<= (inc k) (nth state i)) [i (inc k)]
(and (< (inc i) (count state)) (not= (nth state (inc i)) 0)) [(inc i) 1]
(>= (inc i) (dec (count state))) nil
@gzmask
gzmask / user.behaviors
Last active August 29, 2015 14:05
.lighttable
;; Your file has been converted to the new flat format.
;; Conversion does not preserve comments or indentation.
;; File is backed up at C:\Users\lei203\AppData\Local\LightTable\User\user.behaviors.bak
[
[:app :lt.objs.style/set-skin "dark"]
[:app :lt.objs.sidebar.workspace/workspace.open-on-start]
[:app :lt.plugins.vim/map-keys {",L" ":ltexec paredit.shrink.right",
",l" ":ltexec paredit.grow.right",
"gT" ":ltexec tabs.prev",
"gt" ":ltexec tabs.next",