Skip to content

Instantly share code, notes, and snippets.

@passcod
passcod / MOVE.md
Last active Aug 29, 2015
firefox-always-nightly in the AUR
View music-for-making.markdown

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 Aug 10, 2014
rss_proxy.d
View rss_proxy.d.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 Aug 10, 2014
rss_proxy.cgi
View rss_proxy.cgi.sh
#!/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 Aug 24, 2014
Template file to dump docker-gen's output in YAML format
View yaml.tmpl
---
{{ 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 Aug 29, 2015
Implementation of GNU's dc (reverse-polish arbitrary-precision stack-based command-line calculator) in Ruby
View dc.rb
#!/usr/bin/env ruby
require 'bigdecimal'
class Dc
def initialize
@stack = []
@registers = []
# TODO: support these
@passcod
passcod / markup.html
Created Apr 30, 2011
Another way to hide emails from robots
View markup.html
<span id="email">@</span>
View .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 Apr 12, 2012
SCSS Arrow Please!
View _arrow_bx.scss
/* 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 Dec 11, 2015
Gecko-style #toSource() shim
View toSource2.coffee
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(", ")}]"