This is for Mac OS X and requires npm.
- Open a terminal
- Type
bitly http://www.somewebsite.com/needs/to/be/shortened/
The shortened link is now in your clipboard. Paste the shortened link wherever you need to!
Installation:
In this gist we will first show that we can beat the arc challenge | |
(http://www.paulgraham.com/arcchallenge.html), and then build the library that | |
shows how we did it. This gist is Literate Haskell and is of course executable. The packages needed are happstack-server and applicative-extras, installable using cabal. | |
Let's start with some imports (for now, you can ignore these) | |
> {-# LANGUAGE GADTs, TypeSynonymInstances #-} | |
> module ArcChallenge where | |
> | |
> import Control.Applicative |
diff --git a/example/server.js b/example/server.js | |
index 167fc43..db758a2 100644 | |
--- a/example/server.js | |
+++ b/example/server.js | |
@@ -61,4 +61,16 @@ io.on('connection', function(client){ | |
client.on('disconnect', function(){ | |
client.broadcast({ announcement: client.sessionId + ' disconnected' }); | |
}); | |
-}); | |
\ No newline at end of file |
This is for Mac OS X and requires npm.
bitly http://www.somewebsite.com/needs/to/be/shortened/
The shortened link is now in your clipboard. Paste the shortened link wherever you need to!
Installation:
The following is a non-exhaustive compendium of HTML5 related scripts, frameworks and templates/boilerplates alongside suggested best practices to be used for any HTML5-type project.
Feel free to add to the list and edit as you see fit.
/* http://snipplr.com/view.php?codeview&id=47181 */ | |
/* Credit: Jeffrey Way */ | |
.border-radius( @radius: 3px ) { | |
-webkit-border-radius: @radius; | |
-moz-border-radius: @radius; | |
border-radius: @radius; | |
} | |
.outline-radius( @radius: 3px ) { |
module Jekyll | |
class MathJaxBlockTag < Liquid::Tag | |
def render(context) | |
'<script type="math/tex; mode=display">' | |
end | |
end | |
class MathJaxInlineTag < Liquid::Tag | |
def render(context) | |
'<script type="math/tex">' | |
end |
<!DOCTYPE HTML> | |
<head> | |
<title>Codesnippit NodeJS Twitter Tracker Client</title> | |
</head> | |
<body> | |
<ul></ul> | |
<script> | |
(function() { | |
var script = document.createElement("script"); | |
script.src = "http://code.jquery.com/jquery.min.js"; |
;; peteris's solution to http://4clojure.com/problem/31 | |
#(let [[elt cnt] | |
(let [v (vec %), n (count %)] | |
(loop [i 1, elt [(first v)], cnt [1]] | |
(if (= i n) | |
[elt cnt] | |
(recur (inc i) | |
(if (= (v i) (v (dec i))) | |
elt |
(defn fn-and | |
"Takes a set of functions and returns a fn which returns whether | |
every item in the juxtaposition of those functions is true." | |
([& fns] | |
(let [juxted-fns (apply juxt fns)] | |
(fn [& args] (every? true? (apply juxted-fns args)))))) |
;; peteris's solution to http://4clojure.com/problem/50 | |
#(loop [s %, acu {}] | |
(if (= '() s) | |
(map reverse (vals acu)) | |
(recur (rest s) | |
(if (nil? (find acu (type (first s)))) | |
(assoc acu (type (first s)) (list (first s))) | |
(assoc acu (type (first s)) (cons (first s) (get acu (type (first s))))))))) |