Skip to content

Instantly share code, notes, and snippets.

Avatar

Christian Aust datenimperator

View GitHub Profile
@datenimperator
datenimperator / model.rb
Created Apr 28, 2014
Unique numbering DSL
View model.rb
class Model < ActiveRecord::Base
# setzt :invoice_id Attribut im before_create
has_unique :invoice_id,
scoped_by: lambda{ Time.new.year },
formatter: lambda{ |scope, value| sprintf("R-%04d-%04d", scope, value) }
end
@datenimperator
datenimperator / issues.rb
Created May 6, 2014
Display active, assigned tickets from Gitlab using Ruby
View issues.rb
#!/usr/bin/env ruby
require 'open-uri'
require 'json'
GITLAB='http://your.gitlabhost.com'
TOKEN='security_token'
USERNAME='your_username'
issues = JSON.load(open("#{GITLAB}/api/v3/issues?private_token=#{TOKEN}"))
View test1.sh
$ curl -I "https://static.licdn.com/scds/concat/common/css?h=cfsam81o5sp3cxb7m0hs933c4-ayz9yfto6yuvfbnjryz2uhv2r-154kxlhs4z8rrtcvqfbage7t-7z4tik36jao0xe22l10ei9fcy-5f340g5yhr0lmw2pgno437wcy-58a70hzll4g8kku1jqu5hcq77-6lg80obqw1a6e31g5xzz9modk-24zwqzg0twslliln0crwh71os-ajta1vvnnddstrmknoo01iksx-btxvz0skzcibopne8uegno3ah-e6ngnxj94o59jnla2nbeg59xg-aqatrh64t5i533h03ger8nmga-1qropirar95tlkfqbsa60th2t-974h8s1tcqf8tu9jmk1ya9u2u-1v46v9xbj08je7u9ip252ln8n-3kfbjgrixoegzbffwmpb09dva-20qsp69recmq07kx7d3qe31zw-2fwpxhxm2x0u28ijz7ypc2afv-dh9s2pgf6ghcuifobl7cvitf9&fc=1"
curl: (60) SSL certificate problem: Invalid certificate chain
More details here: http://curl.haxx.se/docs/sslcerts.html
curl performs SSL certificate verification by default, using a "bundle"
of Certificate Authority (CA) public keys (CA certs). If the default
bundle file isn't adequate, you can specify an alternate file
using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
the bundle, the certificate verificatio
View ping.sh
$ ping -c 20 88.198.100.84
PING 88.198.100.84 (88.198.100.84): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
Request timeout for icmp_seq 4
Request timeout for icmp_seq 5
Request timeout for icmp_seq 6
Request timeout for icmp_seq 7
@datenimperator
datenimperator / error.log
Created Aug 30, 2014
sidekiq/paperclip/delayed_paperclip error
View error.log
2014-08-30T13:50:22.477Z 36512 TID-ouv9kmve4 DelayedPaperclip::Jobs::Sidekiq JID-d5633dd7375cb03f87bf47dd INFO: fail: 0.481 sec
2014-08-30T13:50:22.478Z 36512 TID-ouv9kmve4 WARN: {"retry"=>true, "queue"=>"paperclip", "backtrace"=>true, "class"=>"DelayedPaperclip::Jobs::Sidekiq", "args"=>["ProductImage", 2644, "image"], "jid"=>"d5633dd7375cb03f87bf47dd", "enqueued_at"=>1409403315.5664058, "error_message"=>"Argument list too long - identify -format '%wx%h,%[exif:orientation]' '/var/folders/f3/j05ygbhx6cx4ykwbdv6m5nbh000101/T/2e309f3244e197b93dc741957dc7fa1520140830-36512-108qunp.jpg[0]' 2>/dev/null", "error_class"=>"Errno::E2BIG", "failed_at"=>1409403664.329591, "retry_count"=>2, "error_backtrace"=>["/Users/christian/.rvm/gems/ruby-2.1.2@dmh/gems/cocaine-0.5.4/lib/cocaine/command_line/runners/process_runner.rb:34:in `spawn'", "/Users/christian/.rvm/gems/ruby-2.1.2@dmh/gems/cocaine-0.5.4/lib/cocaine/command_line/runners/process_runner.rb:34:in `spawn'", "/Users/christian/.rvm/gems/ruby-2.1.2@dmh/gems/cocaine-0.5
View authors.txt
user1 = Full Name <fullname@email.com>
user1_alias = Full Name <fullname@email.com>
user2 = Another Name <anothername@email.com>
View error.log
Process: com.apple.WebKit.WebContent [4427]
Path: /System/Library/Frameworks/WebKit.framework/Versions/A/XPCServices/com.apple.WebKit.WebContent.xpc/Contents/MacOS/com.apple.WebKit.WebContent
Identifier: com.apple.WebKit.WebContent
Version: 10600 (10600.5.17)
Build Info: WebKit2-7600005017000000~3
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Safari [2458]
User ID: 1025
View gist:209138
#
# SipFaxPref.m
# SipFax
#
# Created by Christian on 12.10.09.
# Copyright (c) 2009 Christian Aust. All rights reserved.
#
require 'osx/cocoa'
require 'client'
View gist:209133
def init
if super_init
@identified = false
@dirty = false
@username, @password, @account_type = 'test', 'abc', SIP_TEAM
self
end
end
View gist:211663
christian@macbookpro:~/Documents/Projekte/SipFax\ otool -L build/Debug/SipFax.prefPane/Contents/MacOS/SipFax
build/Debug/SipFax.prefPane/Contents/MacOS/SipFax:
/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 12.0.0)
/System/Library/Frameworks/PreferencePanes.framework/Versions/A/PreferencePanes (compatibility version 1.0.0, current version 1.0.0)
@executable_path/../Frameworks/RubyCocoa.framework/Versions/A/RubyCocoa (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 36371.0.0)
@loader_path/../Frameworks/BWToolkitFramework.framework/Versions/A/BWToolkitFramework (compatibility version 1.0.0, current version 0.0.0)
@loader_path/../Frameworks/EMKeychain.framework/Versions/A/EMKeychain (compatibility version 1.0.0, current version 1.0.0)
@executable_path/../Frameworks/XMLRPC.framework/Versions/A/XMLRPC (compatibility version 1.0.0, cur
You can’t perform that action at this time.