Skip to content

Instantly share code, notes, and snippets.

View lalo's full-sized avatar

Eduardo Salinas lalo

View GitHub Profile
@acorcutt
acorcutt / gist:1099813
Created July 22, 2011 16:41
Post array of text_field's in rails as array
<%-# items is an array on object e.g. object.items = [1,2,3], we want to display as list of fields, and post back as an array - note the backwards ][ which makes is do this! -%>
<% @object.items.each do |i| %>
<%=f.text_field "items][",:value=>i,:id=>"item-#{SecureRandom.uuid}" %>
<% end %>
@khoparzi
khoparzi / init-1.0.0.hs
Last active August 30, 2020 17:10 — forked from jarmitage/init-1.0.0.hs
tidal goodies ported to 1.0.x
module Init where
-- import Sound.Tidal.SpectralTricks
-- import qualified Sound.Tidal.Scales as Scales
-- import qualified Sound.Tidal.Chords as Chords
import Sound.Tidal.Utils
@hanleybrand
hanleybrand / Mac imposm install.md
Last active January 13, 2021 20:39
Install imposm on a mac with all dependencies in a vm, with postgress.app for postgis

Installing imposm

So, according to the imposm docs:

Imposm runs with Python 2.5, 2.6 and 2.7 and is tested on Linux and Mac OS X. Other dependencies are:

psycopg2: PostgreSQL adapter for Python

Tokyo Cabinet: File-based key-value database for the internal cache

@dmarx
dmarx / LinkFixerClone.py
Last active January 19, 2021 02:20
A simple LinkFixerBot clone developed as a demonstration for anyone who is curious how a simple reddit bot might be coded. To kill this code, spam "Ctrl+C" until it catches the exception.
import praw # simple interface to the reddit API, also handles rate limiting of requests
import re
from collections import deque
from time import sleep
USERNAME = "Your username here"
PASSWORD = "Your password here"
USERAGENT = "Your useragent string here. It should include your /u/username as a courtesy to reddit"
r = praw.Reddit(USERAGENT)
@khoparzi
khoparzi / 20Beats.tidal
Created June 5, 2019 05:34
Just a collection of basic beats suggested by Drum Beats Online in this video https://www.youtube.com/watch?v=mwe4HPOiUms
-- Just a collection of basic beats suggested by Drum Beats Online in this video
-- https://www.youtube.com/watch?v=mwe4HPOiUms
-- n "13" -- Kick
-- n "4" -- Hats
-- n "10" -- Tight Hats
-- n "5" -- Hats alt
-- n "11" -- Open hats
-- n "17" -- Really Open hats
-- n "21" -- Hat pedal
@fogleman
fogleman / osm.py
Created November 28, 2017 21:51
AxiDraw + OpenStreetMap
from imposm.parser import OSMParser
from shapely import geometry, ops
import axi
import math
import sys
# put your lat/lng here
LAT, LNG = 0, 0
@kana
kana / realtime.diff
Created December 4, 2012 09:58
Realtime keystroke recording for Vim
--- src/main.c~ 2012-10-23 12:35:34.000000000 +0900
+++ src/main.c 2012-12-04 18:42:25.000000000 +0900
@@ -2315,6 +2315,7 @@
mch_errmsg("\"\n");
mch_exit(2);
}
+ setvbuf(scriptout, NULL, _IONBF, 0);
break;
#ifdef FEAT_GUI_W32
@kennethreitz
kennethreitz / pr.md
Created September 12, 2012 20:56 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@tsabat
tsabat / zsh.md
Last active December 25, 2023 19:16
Getting oh-my-zsh to work in Ubuntu
@davidfowl
davidfowl / Example1.cs
Last active March 28, 2024 20:36
How .NET Standard relates to .NET Platforms
namespace Analogy
{
/// <summary>
/// This example shows that a library that needs access to target .NET Standard 1.3
/// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET
/// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library.
/// </summary>INetCoreApp10
class Example1
{
public void Net45Application(INetFramework45 platform)