Skip to content

Instantly share code, notes, and snippets.

@crux
crux / pling-plong-and-some.rb
Created March 20, 2011 10:24
playing apple audio samples in in macruby
#!/usr/bin/env rvm macruby
# code taken from: http://merbist.com/tag/nssound/
framework 'Cocoa'
# Cocoa documentation reference:
# http://developer.apple.com/mac/library/documentation/Cocoa/Reference/ApplicationKit/Classes/NSSound_Class/Reference/Reference.html
def sound_dir
#@sound_dir ||= "/Library/Audio/Apple Loops/Apple/iLife Sound Effects/Machines/*aif"
@crux
crux / neo4j startup crash log
Created June 7, 2011 11:23
console log plus contents ouf data/ of a neo4j not starting on mac osx
begin 644 neo4j-advanced-1.4.M02-data+console.log.tgz
M'XL(`$`'[DT``^V=2VPC29K?6>V=7:_6\,FS?F`.@;&!G?$4J7RGR$;-MEI2
M]U9W2U60U-T[Z!D(*3(E915?DTE628T"[(L/ZY,O!L9[MP\&#/AH`X8/<[(/
MZ^L"!@SXY#VM[<,"'I_LB$R2XDO,AY)4==7OT^,GD?%]$1F9D1GYCV!D;;MV
MUO(&7F6-IFF::]LBIC/+V$S'$KINNZ:EF:;K"$VW==>N"&V=A1K;,!IXH2Q*
MJSWT(_\\#+HOEZ9+>S_9%#'A=\6^]_N_4_F@4CGTFN+9B?AC,3+U6N5WY8\A
M?WXM?]3_?Y4MY.[IZ7'E9[_YLY''K^3/S^>2/+I]_?O-7J?F]?MMO_;+H1=Z
MW4'0]2N_W%;5^*'5\LVZ7Z]_^&FO=]GV?WYM:'M78:_C*X\/]_;VZ_KN_GYU
M[Q/3J%IVO5[=V=_?J[K:P2>[N^;!GF-9;U3XR]B[EKB65''OAJFVO[WF/-+:
MOVHOL^W?<ERC(NPUERNV][S]Q_O_,O3Z5[76^9H.A*S[7W,-0S?4_G=,6V?_
@crux
crux / gist:2227909
Created March 28, 2012 16:16
ruby assignment method visibility
#!/usr/bin/env ruby
class A
def a=(x)
puts "-- a=(#{x})"
@a = x
end
def a puts "-- a" @a
end
@crux
crux / hostnamr.rb
Created July 12, 2012 08:13
random concatenation of syllables to get speakable but senseless hostnames
#!/usr/bin/env ruby
Hiragana = %w{
a i u e o
ka ki ku ke ko
sa shi su se so
ta chi tsu te to
na ni nu ne no
ha hi hu he ho
ma mi mu me mo
@crux
crux / gist:4944750
Created February 13, 2013 13:54
doc_pu plugin page sorting from the redmine console
# sorting the doc_pu wiki pages in a redmine. The doc_pu plugin contains an
# option to manually reoorder pages but this is only one by and is awfull to
# use for lots of references.
#
# 'install' this code in the redmine dir:
# $ cat > lib/ac/doc_pu_sorter.rb
#
# execute with the right user(redmine) in the production mode on the server
# from the command line:
#
@crux
crux / gist:fe26226a715bf8e09c27332b5814d0b2
Created October 22, 2019 10:08
test only, nothing to see here
# funktioniert hier eigentlich Markdown?
- absolute
- na bestens
dann kanns ja losgehen

funktioniert hier eigentlich Markdown?

  • absolute
  • na bestens

dann kanns ja losgehen

<?php
/* code below to produce the following output:
empty([ /*empty*/ ]['k']) === true
empty([ 'k'=>'' ]['k']) === true
empty([ 'k'=>true ]['k']) === false
empty([ 'k'=>23 ]['k']) === false
// so far, so good. But WTF:
# this fails:
use function App\Services\Wordpress\{ };
# with:
#
# PHP Fatal error: Uncaught ParseError: syntax error, unexpected token "}"..
# this works:
@crux
crux / cs-quotes.json
Created November 8, 2022 10:51
CS quotes from Notepass++ source code, json version from this: https://news.ycombinator.com/item?id=33516344
[
[
"Notepad++",
"The creation of Notepad++ is due to my need for a decent editor to edit the source code of Notepad++"
],
[
"Notepad++ #1",
"I hate reading other people's code.\nSo I wrote mine, made it as open source project, and watch others suffer."
],
[