Skip to content

Instantly share code, notes, and snippets.

@timaschew
timaschew / complex.coffee
Created September 6, 2013 17:00
js2coffee with pretty print, and 4 spaces indent
module.exports = container:
page:
numbers: [
1
2
3
"four"
"five"
]
one: ["value"]
@timaschew
timaschew / default.coffee
Created September 6, 2013 21:46
js2coffee default (without pretty print) result for complex, nested js files
module.exports = container:
page:
numbers: [1, 2, 3, "four", "five"]
one: ["value"]
empty: []
nestedArray: ["abc", "nasd",
z: 0
y: -1
, [9, 8, 7, [71, 72, 73]], [9, 8, 7, [71, 72, 73]], "asdasd"]
nestedMix: [
@timaschew
timaschew / complex.coffee
Created September 8, 2013 08:10
js2coffee generated output with braces {} around objects that are children of a array
module.exports = container:
page:
numbers: [
1
2
3
"four"
"five"
]
one: ["value"]
@timaschew
timaschew / test.html
Created January 10, 2014 14:45
Jade test
<h1>Jade Test</h1>
<h2>#{}</h2>
<0.8308323819655925></0.4817824566271156>
<foobar></foobar>
<h2>=</h2>0.5204204213805497 This code is &lt;escaped&gt;!
<h2>!=</h2>0.3641710795927793 This code is not <escaped>!
@timaschew
timaschew / description.md
Last active January 3, 2016 00:59
Allinkl Shopware Umstellung von 3.5 auf 4

Ausgangssituation:

  • phiala.de läuft mit shopware 3.5.7 - Rev. 8716 - Zend Version
  • All Inkl PHP 5.2

Schritte für Update auf 4.x

  • Spiegelung von phiala.de erzeugt (FTP + Datenbank) unter der Domain test.phiala.de
  • config.php DB angepasst
  • .htaccess Anpassung für CGI PHP 5.3 Handler
  • Download von ionCube und ersetzen des /engine Ordneres
  • Erfolgreiche Prüfung ob das Backend noch läuft
@timaschew
timaschew / gist:9110336
Created February 20, 2014 09:59
docpad stack trace for: TypeError: Cannot call method 'isDirectory' of null
info: Change detected at 10:56:21 delete /Users/awilhelm/dev/berlinjs.org/src/documents/talks/2014-02-20-My-title----.html.md
error: An error occured:
TypeError: Cannot call method 'isDirectory' of null
at _Class.changeHandler (/Users/awilhelm/dev/berlinjs.org/node_modules/docpad/out/lib/docpad.js:3600:61)
at _Class.EventEmitter.emit (events.js:106:17)
at _Class.bubble (/Users/awilhelm/dev/berlinjs.org/node_modules/docpad/node_modules/watchr/out/lib/watchr.js:177:19)
at _Class.bubble (/Users/awilhelm/dev/berlinjs.org/node_modules/docpad/node_modules/watchr/out/lib/watchr.js:4:61)
at _Class.watchr.children.(anonymous function).watch.listeners.change (/Users/awilhelm/dev/berlinjs.org/node_modules/docpad/node_modules/watchr/out/lib/watchr.js:490:36)
at _Class.EventEmitter.emit (events.js:106:17)
at _Class.bubble (/Users/awilhelm/dev/berlinjs.org/node_modules/docpad/node_modules/watchr/out/lib/watchr.js:177:19)
@timaschew
timaschew / js2coffee.org.js
Last active August 29, 2015 13:57
demo snippest of js2coffee talk at Berlin Node.js Meetup #3 - 2014-03-12 - try it out on http://js2coffee.org
// buggy when switch multiple times (js2coffee, coffee2js, js2coffee, ...)
foo = "bar"
// avoid the bug
main.foo = "bar";
// example for variable shadowing
var x = 0;
main.f = function(err, res) {
var x = 1;
};
@timaschew
timaschew / gist:10781665
Created April 15, 2014 22:05
server log of requested files for MIDI.js demo-Basic.html, server via python -m SimpleHTTPServer
ok (cached soundfont)
192.168.178.34 - - [15/Apr/2014 23:59:31] "GET /demo-Basic.html HTTP/1.1" 200 -
192.168.178.34 - - [15/Apr/2014 23:59:31] "GET /js/MIDI/AudioDetect.js HTTP/1.1" 200 -
192.168.178.34 - - [15/Apr/2014 23:59:31] "GET /js/MIDI/LoadPlugin.js HTTP/1.1" 200 -
192.168.178.34 - - [15/Apr/2014 23:59:31] "GET /js/MIDI/Plugin.js HTTP/1.1" 200 -
192.168.178.34 - - [15/Apr/2014 23:59:31] "GET /js/MIDI/Player.js HTTP/1.1" 200 -
192.168.178.34 - - [15/Apr/2014 23:59:31] "GET /js/Window/DOMLoader.XMLHttp.js HTTP/1.1" 200 -
192.168.178.34 - - [15/Apr/2014 23:59:31] "GET /inc/Base64.js HTTP/1.1" 200 -
192.168.178.34 - - [15/Apr/2014 23:59:31] "GET /inc/base64binary.js HTTP/1.1" 200 -
@timaschew
timaschew / test.coffee
Created May 5, 2014 13:29
how to mix $or and $and with QueryEngine? (http://bevry.me/queryengine/guide)
# query blog items and main nav items
# this doesn't work, I only get the blog items
findFullNav: (lang) ->
@getDatabase().findAllLive
$or:
$and:
mainNav: {$exists: true}
relativeOutDirPath:
$startsWith: lang
@timaschew
timaschew / palindrome-check-test.coffee
Created July 3, 2014 12:10
edge case tests for a palindrom checker, can you implement it?
describe 'palindrome checker', ->
it 'should work for unicode characters (chinese)', (done) ->
expect(palindromChecka "楚人楚").to.equal true
done()
# http://apps.timwhitlock.info/emoji/tables/unicode
it 'should work with 3 byte unicode chars (emoji, unicode)', (done) ->
expect(palindromChecka "\u2764").to.equal true
done()