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 python | |
# | |
# Usage ./main.py <imgur_album_url> | |
# | |
from requests import get | |
from re import sub | |
from sys import argv | |
from os import listdir, mkdir, chdir |
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
function toBase(c, s) { | |
var l = c.length, | |
_ret = ""; | |
while (s !== 0) { | |
_ret += c[s % l]; | |
s = Math.floor(s / l); | |
} | |
return _ret.split("").reverse().join(""); | |
} |
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 node | |
// See http://www.reddit.com/r/dailyprogrammer/comments/25o2bd/5162014_challenge_162_hard_novel_compression_pt_3/ | |
// Usage: | |
// ./162 -c input.txt -o compressed.txt | |
// ./162 -d compressed.txt -o output.txt | |
var fs = require("fs"); | |
var stdio = require("stdio"); // npm install stdio |
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
function intersecting(a, b, c, d) { | |
var intersection = [((a[0] * b[1] - a[1] * b[0]) * (c[0] - d[0]) - (a[0] - b[0]) * (c[0] * d[1] - c[1] * d[0])) / | |
((a[0] - b[0]) * (c[1] - d[1]) - (a[1] - b[1]) * (c[0] - d[0])), | |
((a[0] * b[1] - a[1] * b[0]) * (c[1] - d[1]) - (a[1] - b[1]) * (c[0] * d[1] - c[1] * d[0])) / | |
((a[0] - b[0]) * (c[1] - d[1]) - (a[1] - b[1]) * (c[0] - d[0]))]; | |
function between(a, b, c) { | |
return c >= Math.min(a, b) && c <= Math.max(a, b); | |
} | |
if (between(a[0], b[0], intersection[0]) && | |
between(c[0], d[0], intersection[0]) && |
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
function formatComments() { | |
var commments = document.querySelectorAll("div[data-ups]"); | |
for (var i = 0, l = commments.length; i < l; ++i) { | |
var data = commments[i]; | |
var likes = data.getAttribute("data-ups"); | |
var dislikes = data.getAttribute("data-downs"); | |
if (likes !== undefined && dislikes !== undefined) { | |
var post = data.querySelector(".entry.unvoted"); | |
if (post && !post.querySelector(".wooo")) { |
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
// Important updates: | |
// #6 - load function works as intended | |
// #8 - core functionality works with loading questions and calculating scores | |
// #9 - completion of task | |
var Quiz = { | |
questions: [ | |
{title: "How many hairs are on a pony?", choices: ["0", "1", "2", "More than two"], correctAnswer: 3}, | |
{title: "Who lives in the Barbie Dream House?", choices: ["Barbie & Ken", "Peter & Mary", "Ben & Jerry", "It is an empty house"], correctAnswer: 0} |
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
function! GetModeName(mode) | |
if a:mode ==# "n" | |
return "NORMAL" | |
elseif a:mode ==# "i" | |
return "INSERT" | |
elseif a:mode ==# "V" | |
return "VISUAL LINE" | |
elseif a:mode ==# "v" | |
return "VISUAL" | |
elseif a:mode ==# "" |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Hex Time</title> | |
<style> | |
body { | |
transition: background-color 0.2s ease-out; | |
-webkit-transition: background-color 0.2s ease-out; | |
-moz-transition: background-color 0.2s ease-out; |
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
<a href="#1">1</a> <a href="#2">2</a> <a href="#3">3</a> <a href="#4">4</a> <a href="#5">5</a> <a href="#6">6</a> <a href="#7">7</a> <a href="#8">8</a> <a href="#9">9</a> <a href="#10">10</a> <a href="#11">11</a> <a href="#12">12</a> <a href="#13">13</a> <a href="#14">14</a> <a href="#15">15</a> <a href="#16">16</a> <a href="#17">17</a> <a href="#18">18</a> <a href="#19">19</a> <a href="#20">20</a> <a href="#21">21</a> <a href="#22">22</a> <a href="#23">23</a> <a href="#24">24</a> <a href="#25">25</a> <a href="#26">26</a> <a href="#27">27</a> <a href="#28">28</a> <a href="#29">29</a> <a href="#30">30</a> <a href="#31">31</a> <a href="#32">32</a> <a href="#33">33</a> <a href="#34">34</a> <a href="#35">35</a> <a href="#36">36</a> <a href="#37">37</a> <a href="#38">38</a> <a href="#39">39</a> <a href="#40">40</a> <a href="#41">41</a> <a href="#42">42</a> <a href="#43">43</a> <a href="#44">44</a> <a href="#45">45</a> <a href="#46">46</a> <a href="#47">47</a> <a href="#48">48</a> <a href="#49">49</a> <a href="#50" |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
html, body { | |
-webkit-font-smoothing: subpixel-antialiased; | |
} | |
#links { | |
display: block; | |
color: #ddd; |
OlderNewer