Skip to content

Instantly share code, notes, and snippets.

View gist:1959578
a = [1, 2, 3, 4]
for x in range(0, len(a), 2):
pair = a[x:x+2]
print(pair)
... or individually ...
for x in range(0, len(a), 2):
print(str(a[x]) + ', ' + str(a[x+1]))
@dfletcher
dfletcher / core.clj
Last active Dec 3, 2018
JavaFX Clojure app template
View core.clj
(ns myapp.core (:gen-class))
(gen-class
:name myapp.Application
:extends javafx.application.Application
:prefix "myapp-")
(defn ^:Private myapp-start
"Implements javafx.application.Application.start."
[app ^javafx.stage.Stage stage]
@dfletcher
dfletcher / tsws
Last active Jul 21, 2018
Totally simple web server using Bash and netcat (nc)
View tsws
Moved to a proprer repositoy, TSWS is a real boy now!
https://github.com/dfletcher/tsws
PRs welcomed.
@dfletcher
dfletcher / mybartiksub.info.yml
Created Oct 7, 2019
Drupal 8 Quick Bartik subtheme
View mybartiksub.info.yml
name: My Bartik subtheme
type: theme
core: 8.x
base theme: bartik
description: 'Bartik subtheme.'
alt text: 'Bartik subtheme.'
libraries:
- 'mybartiksub/theme'