Skip to content

Instantly share code, notes, and snippets.

@passcod
passcod / MOVE.md
Last active August 29, 2015 13:56
firefox-always-nightly in the AUR

Music for Making

Félix Saparelli

  • Anthony Gonzales
    • Tech 49
  • Antonín Dvořák
    • Allegro con fuoco ("From The New World")
  • Antonio Vivaldi
    • The Four Seasons: Concerto N°2 in G Minor, RV315, "Summer": I. Allegro non molto
  • Apocalyptica
anonymous
anonymous / rss_proxy.d.d
Created August 10, 2014 09:57
rss_proxy.d
module rss_proxy;
import tools.base, std.file, tools.downloader;
string download(string url) {
char* tmpfilp = tmpnam(null);
if (!tmpfilp) throw new Exception("could not get temp file name");
auto tmpfil = toString(tmpfilp);
scope(exit) unlink(toStringz(tmpfil));
if (system(toStringz("/usr/bin/wget --timeout=60 -q -O \""~tmpfil~"\" \""~url~"\"")) == -1) {
anonymous
anonymous / rss_proxy.cgi.sh
Created August 10, 2014 10:01
rss_proxy.cgi
#!/bin/bash
PATH="/mnt/data/www/temp_rss/"
DATE=/bin/date
STAT=/usr/bin/stat
SED=/bin/sed
TOUCH=/usr/bin/touch
EXECPATH="/mnt/data/www/rss_proxy"
TERM=""
if [ -z "$QUERY_STRING" ] || [[ $QUERY_STRING == url* ]]
then
@passcod
passcod / yaml.tmpl
Created August 24, 2014 12:20
Template file to dump docker-gen's output in YAML format
---
{{ range $_, $cont := $ }}
{{ $addrLen := len $cont.Addresses }}
{{ $envLen := len $cont.Env }}
{{ $regLen := len $cont.Image.Registry }}
- id: "{{ $cont.ID }}"
{{ if eq $addrLen 0 }}
addresses: ~
{{ else }}
addresses:
@passcod
passcod / dc.rb
Last active August 29, 2015 14:18
Implementation of GNU's dc (reverse-polish arbitrary-precision stack-based command-line calculator) in Ruby
#!/usr/bin/env ruby
require 'bigdecimal'
class Dc
def initialize
@stack = []
@registers = []
# TODO: support these
@passcod
passcod / markup.html
Created April 30, 2011 04:35
Another way to hide emails from robots
<span id="email">@</span>
@passcod
passcod / .excess
Last active September 27, 2015 07:38
Excess
# Excess (v.FINAL)
# Félix Saparelli 2011-13
# Public Domain (CC0)
xs() { echo "Excess is dead. See https://github.com/passcod/bin"; }
xs-update() { xs; }
@passcod
passcod / _arrow_bx.scss
Created April 12, 2012 06:58
SCSS Arrow Please!
/* Coded by @passcod, MIT Licensed: passcod.mit-license.org
Adapted from @shojberg's cssarrowplease.com
*/
@mixin arrow-box( $selector: ".arrow-box",
$position: "top",
$arrow_size: 10px,
$border_width: 2px,
$box_color: #333,
$border_color: #ccc) {
@passcod
passcod / toSource2.coffee
Last active December 11, 2015 09:08
Gecko-style #toSource() shim
toSource2 = (data) ->
typ = typeof data
if typ == "number" and isNaN data
"NaN"
else if ["string", "number", "boolean"].indexOf(typ) != -1
JSON.stringify data
else if typ == "function"
"(#{data.toString()})"
else if data instanceof Array
"[#{data.map(toSource2).join(", ")}]"