Skip to content

Instantly share code, notes, and snippets.

@acid
acid / first\ try.rb
Created January 27, 2018 16:20
My first time playing around with SonicPi
use_bpm 120
live_loop :yeah do
with_fx :ring_mod do
with_fx :wobble do
use_synth :tb303
sample :bass_hard_c, attack: 3, release: 2, amp: 4, slope_below: 5, pitch: -12
sleep 2
end
@acid
acid / pre-commit
Last active April 6, 2020 16:15
Pre-commit script for our rails app
#!/usr/bin/env ruby
require 'rubocop'
require 'english'
ADDED_OR_MODIFIED = /A|AM|^M/
# to prevent code injection: system is a dangerous call
def raise_single_quote_error
raise ArgumentError, 'Single quotes are not allowed in filenames here.'
@acid
acid / pre-push
Last active April 7, 2017 16:16 — forked from matteosister/pre-commit
pre-push hook for our phoenix app
#!/bin/sh
# exit on any error (the called tool output should be enough)
set -e
# credo checks
mix credo --strict
# tests
mix test
@acid
acid / gist:f7e918a919a49f7f3ff4
Created July 21, 2015 10:24
How Chrome caused my System to crash
Jul 21 11:51:22 Edoras.home GoogleSoftwareUpdateDaemon[9784]: -[KSUpdateCheckAction(KSServerUpdateRequestDelegate) serverRequest:fetchedWithResponse:] KSUpdateCheckAction received KSServerUpdateResponse: <KSOmahaServerUpdateResponse:0x31c690
server=<KSOmahaServer:0x3162f0>
url="https://tools.google.com/service/update2?cup2hreq=5f60b48be22b0bebbe6692f50405cf3d006ce025a6c5e101d10258ec48436bfb&cup2key=5:1768919880"
status=200
tickets=1
activeTickets=1
rollCallTickets=1
data=
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<gupdate xmlns="http://www.google.com/update2/response" protocol="2.0" server="prod">
### Keybase proof
I hereby claim:
* I am acid on github.
* I am netsteward (https://keybase.io/netsteward) on keybase.
* I have a public key whose fingerprint is 4A6F 33A4 750A 6A7C 176D 6DA5 0429 81F4 B05C 8060
To claim this, I am signing this object:
Das Grundrezept stammt von der fantastischen Veganguerilla, wir haben aber noch ein wenig an der Zubereitung und den Gewürzen geschraubt:
1 Packung (100 g) Reiswaffeln, gesalzen
2 Zwiebeln
350 ml lauwarme Gemüsebrühe
60g Tomatenmark
Salz
Pfeffer
Gewürzmischung “Hackfleischwürzer”
require 'uri'
require 'digest/md5'
caOrderValue = '0.00'; # orem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sollicitudin, mi ac lobortis feugiat, ligula augue eleifend libero, vitae suscipit sem nisi ac augue
caOrderReference = URI::escape('blafoo');
caEventID = 'somenumber'; # orem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sollicitudin, mi ac lobortis feugiat, ligula augue eleifend libero, vitae suscipit sem nisi ac augue
caComment = ''; # lorem ipsum
caMultiple = '1';
caItems = ''; # (Optional) orem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sollicitudin, mi ac lobortis feugiat, ligula augue eleifend libero, vitae suscipit sem nisi ac augue.
# Aenean hendrerit, neque at imperdiet auctor, diam eros interdum lorem, eu suscipit augue risus id neque.
addWorksListener($('.commodity_works'));
function addWorksListener (obj) {
obj.change(function () {
if ( $('.commodity_works').size() == 1 ) {
var id = $('#commodity_works').val();
pasteDataFromWork(id);
} else {
$('.commodity_works').each( function() {
$.getJSON( 'http://fileservr.technoload.abc:3000/works/' + $(this).val() + '/filetype.json', function (data,result) {
@acid
acid / works_helper.rb
Created January 13, 2010 00:56
There seem to be no u helper on jruby, but you can use url_escape http://github.com/bougyman/url_escape
require 'url_escape'
module Fileservr::WorksHelper
def new_work_path_with_session_information
session_key = ActionController::Base.session_options[:key]
new_fileservr_work_path(session_key => cookies[session_key], request_forgery_protection_token => form_authenticity_token)
end
def javascript_for_uploader
@acid
acid / blubb.sh
Created January 11, 2010 22:39
Eine kleine Hilfe für arme Info-Studenten. Ich weiß nicht, ob /etc/group parsen das Sinnigste ist, aber es ist das Erste, was mir gerade einfällt ;)
#! /bin/bash
# Name
echo -n "Username:"
read name
#home
echo -n "Homeverzeichnis:"
read home
#Gruppe
echo -n "Gruppe:"
read gruppe