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 '[leiningen.exec :as le]) | |
(ns foo | |
(:require [clojure.string :as str])) | |
(def source-text "https://gist.githubusercontent.com/pqr/0cf155de6b8f95c3c400/raw/56fc9aa6c06bf3e55a2a02d3e4a857580feff2bc/haskell_vs_php_example.txt") | |
(defn get-lines [text] (map str/trim (str/split-lines text))) | |
(defn drop-header-line [lines] | |
(if (re-find #"Container No\\." (first lines)) |
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 clj-brute.core | |
(:require [clojure.core.async :as async :refer [go chan <!! >!!]] | |
[digest :refer [md5]]) | |
(:gen-class)) | |
(def password-hash (md5 "zzzzz")) | |
(defn next-byte [^Byte b] | |
(case (char b) | |
\z (byte \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
<?php | |
$isPartTwo = true; | |
function def ($name, $val) { | |
global $isPartTwo; | |
if ($name == "b" and $isPartTwo) $val = 956; | |
eval ("function _{$name} () { static \$res; if (!\$res) \$res = {$val}; return \$res; ;}"); | |
}; |
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
<?php | |
class User { | |
public | |
$name, | |
$lastName; | |
public function __construct($name, $lastName) { | |
$this->name = $name; | |
$this->lastName = $lastName; |
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
<?php namespace spec { | |
abstract class spec { | |
abstract function desc () : string; | |
abstract function derive ($c) : spec; | |
abstract function sigma () : spec; | |
} | |
class spec_ok extends spec { | |
function desc () : string { return "ok"; } | |
function derive ($_) : spec { return $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
{:deps {datascript {:mvn/version "0.16.6"} | |
clj-time {:mvn/version "0.14.4"} | |
org.clojure/test.check {:mvn/version "0.9.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
alias clean_boot='echo sudo apt-get purge $(dpkg -l linux-{image,headers}-"[0-9]*" | awk "/ii/{print $2}" | grep -ve "$(uname -r | sed -r 's/-[a-z]+//')")' |
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 day3 | |
(:require [clojure.set :refer [intersection]])) | |
; (def input1 "R75,D30,R83,U83,L12,D49,R71,U7,L72") | |
; (def input2 "U62,R66,U55,R34,D71,R55,D58,R83") | |
; (def input1 "R98,U47,R26,D63,R33,U87,L62,D20,R33,U53,R51") | |
; (def input2 "U98,R91,D20,R16,D67,R40,U7,R15,U6,R7") |