A Pen by Domingo E. Savoretti on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// XMLHttpRequest | |
var xhr = new XMLHttpRequest(); | |
xhr.open('POST', url, true); | |
xhr.responseType = 'arraybuffer'; | |
xhr.onload = function () { | |
if (this.status === 200) { | |
var filename = ""; | |
var disposition = xhr.getResponseHeader('Content-Disposition'); | |
if (disposition && disposition.indexOf('attachment') !== -1) { | |
var filenameRegex = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="app"> | |
<h2>{{ title }}</h2> | |
<p> | |
<span class= "bordered"> | |
{{ count }} | |
</span> | |
| |
<button v-on:click="count += 10"> | |
+ 10 | |
</button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn hanoi | |
([n] (hanoi n 1 2 3 '())) | |
([n from aux to moves] | |
(if (= 1 n) (cons (list from to) moves) | |
(let [moves (hanoi (dec n) aux from to moves)] | |
(let [moves (cons (list from to) moves)] | |
(let [moves (hanoi (dec n) from to aux moves)] | |
moves)))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cljs.user=> (+ 3 4) | |
7 | |
cljs.user=> (char 9812) | |
"♔" | |
cljs.user=> (unicode 65) | |
ERROR - Cannot read property 'call' of undefined | |
cljs.user=> (map char (range 9812 9824)) | |
("♔" "♕" "♖" "♗" "♘" "♙" "♚" "♛" "♜" "♝" "♞" "♟") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import uno | |
from com.sun.star.beans import PropertyValue | |
from pythonscript import ScriptContext | |
import os | |
import sys | |
import time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def average(v1, v2): | |
return (v1 + v2) / 2.0 | |
def square(n): | |
return n * n | |
def sqrt(n): | |
def improve(guess): | |
return average(guess, n / guess) | |
def good_enough(guess): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env iced | |
# only Iced CoffeeScript (http://maxtaco.github.com/coffee-script/) will be able | |
# to run this, as await and defer are not yet included in | |
#mainstream CoffeeScript, at least, as of 2012-04-27 | |
acum = 0 | |
interval = parseInt(process.argv[2]) or 1000 | |
console.log "Starting counter" | |
for n in [1..5] | |
await setTimeout(defer(), interval) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn factorial [n] | |
(reduce * (range 1 (inc n)))) |