Skip to content

Instantly share code, notes, and snippets.

View maca's full-sized avatar

Macario Ortega maca

View GitHub Profile
@lukeholder
lukeholder / das_download.rb
Last active October 12, 2022 01:32 — forked from itsgoingd/das_download.rb
Script to download all Destroy All Software screencasts w/ login (works as of Apr 2021)
#! /usr/bin/env ruby
# usage:
# $ das_download.rb email password
# based on various gists from this thread https://gist.github.com/maca/1798070
require "mechanize"
require "nokogiri"
require "fileutils"
class DasDownloader
!/usr/bin/env bash
# this script assumes a fresh Arch Linux 2013.05 x64
export PLUGINHOOK_REPO=${DOKKU_REPO:-"https://github.com/progrium/pluginhook.git"}
export DOKKU_REPO=${DOKKU_REPO:-"https://github.com/juranki/dokku.git"}
# filesystem conflicts with some other system, so ignore it first
pacman -Syu -q --noconfirm --ignore filesystem
pacman -S -q --noconfirm --needed \
@maca
maca / example.erb.html
Created July 12, 2012 08:15
Jquery plugin for adding and removing nested records (Rails accepts nested attributes for)
<!-- Sorry, this example is with formtastic but I think it would work the same with vanilla rails form helpers -->
<%= semantic_form_for @survey do |form| %>
<fieldset class="nested_models answers" data-association="answers">
<%- form.object.answers.build %>
<%= form.semantic_fields_for :answers do |answer| %>
<%- record = answer.object %>
<fieldset class="<%= record.new_record? ? :new : nil %>">
@bjornharrtell
bjornharrtell / Coffeescript ctags
Created June 9, 2012 17:14 — forked from yury/Coffeescript ctags
ctags definitions for coffeescript. Detects classes, static/class methods, fields, static fields, plain functions, variables.
--langdef=coffee
--langmap=coffee:.coffee
--regex-coffee=/(^|=[ \t])*class ([A-Za-z]+\.)*([A-Za-z]+)( extends [A-Za-z.]+)?$/\3/c,class/
--regex-coffee=/^[ \t]*(module\.)?(exports\.)?@?([A-Za-z.]+):.*[-=]>.*$/\3/m,method/
--regex-coffee=/^[ \t]*(module\.)?(exports\.)?([A-Za-z.]+)[ \t]+=.*[-=]>.*$/\3/f,function/
--regex-coffee=/^[ \t]*([A-Za-z.]+)[ \t]+=[^->\n]*$/\1/v,variable/
--regex-coffee=/^[ \t]*@([A-Za-z.]+)[ \t]+=[^->\n]*$/\1/f,field/
--regex-coffee=/^[ \t]*@([A-Za-z.]+):[^->\n]*$/\1/f,static field/
--regex-coffee=/^[ \t]*([A-Za-z.]+):[^->\n]*$/\1/f,field/
--regex-coffee=/(constructor: \()@([A-Za-z.]+)/\2/f,field/
@ianmurrays
ianmurrays / devise.es.yml
Created March 19, 2012 19:53
Devise 2.0 Spanish Locale
es:
errors:
messages:
expired: "ha expirado, por favor pide una nueva"
not_found: "no encontrado"
already_confirmed: "ya fue confirmada. Intenta ingresar."
not_locked: "no ha sido bloqueada"
not_saved:
one: "Ha habido 1 error:"
other: "Han habido %{count} errores:"
@respectTheCode
respectTheCode / static_server.js
Created February 27, 2012 20:36 — forked from ryanflorence/static_server.js
Node.JS static file web server. Put it in your path to fire up servers in any directory, takes an optional port argument.
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs"),
mime = require("mime")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
@ckdake
ckdake / Gemfile
Created November 3, 2011 18:38
Rails 3.1 Assets on S3 with HTTPS
gem 'fog' # Storage on S3 for carrierwave
gem 'rmagick' # Resizes images and makes thumbnails
gem 'carrierwave' # Image attachments, newer version doesn't work with local files preview hack
gem 'asset_sync' # Syncs assets to S3
class Proc
def in_discomfort?; :me; end
end
you_are = you =
->(you) do
self.inspect until true
@ryanflorence
ryanflorence / static_server.js
Last active July 21, 2024 12:43
Node.JS static file web server. Put it in your path to fire up servers in any directory, takes an optional port argument.
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);