Skip to content

Instantly share code, notes, and snippets.

@rarous
rarous / orig.clj
Last active November 27, 2017 09:38
Refactoring of Tic-Tac-Toe in Clojure
(ns piskvorky.core
(:require [clojure.string :as s])
(:gen-class))
(defn usage []
(println "Ahoj v piskvorkach naslepo.\nPovolene prikazy jsou:\nnew - nova hra\nquit - konec\n[a-i][0-9] - tah na pole, kde rada je pozice a, b, c, d, e, f, g, h, i. Sloupec je 1 ... az 9.\nformat zapisu je napr. e5\nZacina x"))
(defn make-board []
(vec (repeat 9 (vec (repeat 9 :nothing)))))
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active May 4, 2024 21:33
A badass list of frontend development resources I collected over time.
(ns aaa.core
(:import [java.io File]
[org.apache.sanselan ImageReadException Sanselan]
[org.apache.sanselan.common IImageMetadata, RationalNumber]
[org.apache.sanselan.formats.jpeg JpegImageMetadata]
[org.apache.sanselan.formats.tiff TiffField TiffImageMetadata]
[org.apache.sanselan.formats.tiff.constants ExifTagConstants
GPSTagConstants TagInfo TiffConstants TiffTagConstants])
(:gen-class))
@acardona
acardona / parse-bibtex-with-monads.clj
Created September 8, 2012 09:13
A parser for a subset of BibTeX files, written with clojure monads
; Albert Cardona, 2012-09-08
; http://albert.rierol.net/clojure-monads.html
(ns my.parse.bib5
(:use [clojure.algo.monads :only [domonad with-monad state-t maybe-m fetch-state set-state m-seq m-plus m-result]])
(:use [clojure.string :only [lower-case]])
(:use [clojure.pprint :only [pprint]]))
(set! *warn-on-reflection* true)
@phred
phred / pedantically_commented_playbook.yml
Last active November 3, 2023 01:55
Very complete Ansible playbook, showing off all the options
---
####
#### THIS IS OLD AND OUTDATED
#### LIKE, ANSIBLE 1.0 OLD.
####
#### PROBABLY HIT UP https://docs.ansible.com MY DUDES
####
#### IF IT BREAKS I'M JUST SOME GUY WITH
#### A DOG, OK, SORRY
####
@nailor
nailor / gist.py
Created October 24, 2011 08:07
Deaccent unicode strings
# Deaccent unicode strings.
#
# unicodedata.normalize('NFKD', unicodestring): do a compatibility
# decomposition of the unicode string
#
# unicodedata.category(somecharacter): Find the unicode category
# for a character. Category 'Mn' contains all combining accents
import unicodedata
@esperlu
esperlu / mysql2sqlite.sh
Created April 27, 2011 05:46
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
// outlets
IBOutlet UILabel *label;
// actions
- (IBAction)onChange:(id)sender;
// storage
[[NSUserDefaults standardUserDefaults] storeFloat: 123 forKey: @"key"];
float value = [[NSUserDefaults standardUserDefaults] floatForKey: @"key"];