Skip to content

Instantly share code, notes, and snippets.

@ftrain
ftrain / rhymes.clj
Last active July 14, 2023 22:20
Annotated rhyming dictionary
;; This is at: https://gist.github.com/8655399
;; So we want a rhyming dictionary in Clojure. Jack Rusher put up
;; this code here:
;;
;; https://gist.github.com/jackrusher/8640437
;;
;; I'm going to study this code and learn as I go.
;;
;; First I put it in a namespace.
(ns react-cljs.core
(:require React))
(declare render)
(defn handle-change [e]
(render {:text (.. e -target -value)}))
(defn render [{:keys [text]}]
(React/renderComponent
(ns blog.errors.core
(:require-macros
[cljs.core.async.macros :refer [go]]
[blog.utils.macros :refer [<?]])
(:require
[cljs.core.async :refer [>! <! chan close!]]))
;; convert Node.js async function into a something
;; that returns a value or error on a channel
(defn run-task [f & args]
@jamesmacaulay
jamesmacaulay / Clojure.sublime-settings
Last active January 18, 2021 19:01
Clojure stuff for Sublime Text 2. Files live in ~/Application Support/Sublime Text 2/Packages/User
// installed Clojure packages:
//
// * BracketHighlighter
// * lispindent
// * SublimeREPL
// * sublime-paredit
{
"word_separators": "/\\()\"',;!@$%^&|+=[]{}`~?",
"paredit_enabled": true,
@dfuenzalida
dfuenzalida / fizzbuzz.clj
Created April 8, 2013 14:17
The FizzBuzz problem in "moderately idiomatic" Clojure
(defn fizzbuzz
"Prints the numbers from 1 to 100. But for multiples of three prints
'Fizz' instead of the number and for the multiples of five prints
'Buzz'. For numbers which are multiples of both three and five prints
'FizzBuzz'"
[]
(doall
(map
#(println
(some
@avescodes
avescodes / Editing Clojure with Emacs
Last active July 5, 2022 13:32
Get started editing Clojure in Emacs with this basic config.
Check out README.md to get started editing Clojure with Emacs.
@dfuenzalida
dfuenzalida / detective_conan.py
Created October 8, 2012 01:17
Detective Conan en DailyMotion
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Parsea la página de busquedas de DailyMotion para encontrar
# episodios de Detective Conan, busca las URL y las imprime,
# para usar junto con JDownloader
import urllib2
import time
from BeautifulSoup import BeautifulSoup
@swannodette
swannodette / gist:3217582
Created July 31, 2012 14:52
sudoku_compact.clj
;; based on core.logic 0.8-alpha2 or core.logic master branch
(ns sudoku
(:refer-clojure :exclude [==])
(:use clojure.core.logic))
(defn get-square [rows x y]
(for [x (range x (+ x 3))
y (range y (+ y 3))]
(get-in rows [x y])))
@btoone
btoone / curl.md
Last active April 2, 2024 20:18
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@leon
leon / play.conf
Created March 26, 2012 12:27
Upstart script for Play Framework 2.0
# Upstart script for a play application that binds to an unprivileged user.
# put this into a file like /etc/init/play.conf
#
# This could be the foundation for pushing play apps to the server using something like git-deploy
# By calling service play stop in the restart command and play-start in the restart command.
#
# Usage:
# start play
# stop play
# restart play