An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
(import 'org.apache.commons.mail.SimpleEmail) | |
(doto (SimpleEmail.) | |
(.setHostName "smtp.gmail.com") | |
(.setSslSmtpPort "465") | |
(.setSSL true) | |
(.addTo "[email protected]") | |
(.setFrom "[email protected]" "Lucky Clojurian") | |
(.setSubject "Hello from clojure") | |
(.setMsg "Wasn't that easy?") | |
(.setAuthentication "[email protected]" "yourpassword") |
(ns fileupload.core | |
(:use [net.cgrand.enlive-html | |
:only [deftemplate defsnippet content clone-for | |
nth-of-type first-child do-> set-attr sniptest at emit*]] | |
[compojure.core] | |
[ring.adapter.jetty]) | |
(:require (compojure [route :as route]) | |
(ring.util [response :as response]) | |
(ring.middleware [multipart-params :as mp]) | |
(clojure.contrib [duck-streams :as ds])) |
#!/bin/sh | |
### BEGIN INIT INFO | |
## END INIT INFO | |
# Path to play install folder | |
PLAY_HOME=/usr/share/play | |
PLAY=$PLAY_HOME/play | |
# Path to the JVM | |
JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk |
# 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 |
An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
;; 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]))) |
#!/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 |
Check out README.md to get started editing Clojure with Emacs. |
(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 |
// installed Clojure packages: | |
// | |
// * BracketHighlighter | |
// * lispindent | |
// * SublimeREPL | |
// * sublime-paredit | |
{ | |
"word_separators": "/\\()\"',;!@$%^&|+=[]{}`~?", | |
"paredit_enabled": true, |