Skip to content

Instantly share code, notes, and snippets.

@acid
acid / Output: uninitialized Constant
Created December 6, 2009 16:42
Middleware Problems
fileservr:/usr/local/development/bla# rake middleware --trace
(in /usr/local/development/bla)
** Invoke middleware (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
uninitialized constant FlashSessionCookieMiddleware
/usr/local/jruby-1.4.0/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:443:in `load_missing_constant'
/usr/local/jruby-1.4.0/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in `const_missing_with_dependencies'
/usr/local/jruby-1.4.0/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:92:in `const_missing'
fileservr:/usr/local/development/tnl-com# rake middleware --trace
(in /usr/local/development/tnl-com)
** Invoke middleware (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute middleware
use Rack::Lock
use ActionController::Failsafe
use FlashSessionCookieMiddleware, "_tnl-com_session"
use ActiveRecord::ConnectionAdapters::ConnectionManagement
@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
@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
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) {
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.
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”
### 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:
@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">
@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