Skip to content

Instantly share code, notes, and snippets.

vagrant@dokku:~$ sudo pip install diamond
Downloading/unpacking diamond
Downloading diamond-4.0.515-py2.py3-none-any.whl (313kB): 313kB downloaded
Requirement already satisfied (use --upgrade to upgrade): configobj in /usr/lib/python2.7/dist-packages (from diamond)
Downloading/unpacking psutil (from diamond)
Downloading psutil-5.0.1.tar.gz (326kB): 326kB downloaded
Running setup.py (path:/tmp/pip_build_root/psutil/setup.py) egg_info for package psutil
warning: manifest_maker: MANIFEST.in, line 14: 'recursive-include' expects <dir> <pattern1> <pattern2> ...
@timaschew
timaschew / random-numbers-randomized.js
Created December 18, 2016 22:05
just copy and paste in your browser developer toolbar
timeInSeconds = 10;
maxNumber = 3;
rounds = 55;
while (rounds > 0) {console.log(rounds); setTimeout(() => {document.body.textContent = 1 + Math.floor(Math.random()* maxNumber) }, 1000 * timeInSeconds * Math.random()); rounds--}
setTimeout(() => {document.writeln("<br><h1>FERTIG</h1>")}, 1000 * timeInSeconds)
@timaschew
timaschew / gif-show-smippet.html
Created November 28, 2016 17:21
hallo-piepmatz gif-show
<script>
var getAttr = function(element, attr) {
return element.attributes[attr].value;
};
var hideAll = function(parent) {
for (var i=0; i<parent.children.length; i++) {
var child = parent.children[i];
child.style.display = 'none';
}
@timaschew
timaschew / write.js
Created October 25, 2016 14:03
generators + promises = awesome code flow
const Promise = reuqire('bluebird')
// mach aus callback style -> promise style
// aber dafür muss man "Async" an die Funktionen drangehängt werden
const fs = Promise.promisifyAll(require('fs'))
module.exports = co(function*(filename, text) {
return yield fs.readFileSync(filename, text)
})
@timaschew
timaschew / engagement.md
Last active September 24, 2016 08:28
A successful engagement for a developer

HTTP POST

/anna/hand/left/finger/4

 {
  "ring": {
   "type": "engaged", 
   "gemstone": "aquamarine",
   "color": "rose gold"
 } 
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.js"></script>
<div class="video-container">
<video id="v1" width="100%" src="out2.mp4" autoplay="true" loop="true"></video>
<video id="v2" width="100%" src="out2.mp4" loop="true"></video>
</div>
<style>
#v2 {
opacity: 0;
}
video {
@timaschew
timaschew / rplan-bug-report.md
Last active August 31, 2016 19:34
Bug reports for rplan

I created this structure

  • A
    • B
      • B1
      • B2

Then I moved B1 and B2 to A and the error happens when I tried to delete B

@timaschew
timaschew / index.js
Last active July 22, 2016 14:53
requirebin sketch
const DEEPSTREAM_HOST = 'deepstream-test.herokuapp.com:80'
const result = document.getElementById('result')
const deepstream = require('deepstream.io-client-js')
const client = deepstream(DEEPSTREAM_HOST)
client.on('error', function() {
print(arguments, '#f44') // red
})
client.login({
user: 'requirebin'
}, (success, data) => {
@timaschew
timaschew / index.js
Created July 22, 2016 14:50
requirebin sketch
const DEEPSTREAM_HOST = 'deepstream-test.herokuapp.com:80'
const result = document.getElementById('result')
const deepstream = require('deepstream.io-client-js')
const client = deepstream(DEEPSTREAM_HOST)
client.on('error', function() {
print(arguments, '#f44') // red
})
client.login({
user: 'requirebin'
}, (success, data) => {
@timaschew
timaschew / index.js
Created July 22, 2016 14:37
requirebin sketch
// Welcome! require() some modules from npm (like you were using browserify)
// and then hit Run Code to run your code on the right side.
// Modules get downloaded from browserify-cdn and bundled in your browser.
const DEEPSTREAM_HOST = 'deepstream-test.herokuapp.com:80'
const deepstream = require('deepstream.io-client-js')
const result = document.getElementById('result')
result.textContent = window.location.pathname
/*
const client = deepstream(DEEPSTREAM_HOST).login({