Skip to content

Instantly share code, notes, and snippets.

@piotrpalek
piotrpalek / module.py
Last active December 16, 2015 04:39
Create symlinks and recreate directory structure from specified source path to destination. Desciption in file, after creating the files the script creates an "cache" file, which remembers what directories and symlinks it created so you can later remove them with the optional argument "--remove" to remove all created files. Useful if you want to…
#Eg. let's say you have this path
#something/abc/123.file
#something/ccc
#something/bbb.file
#running this script with the arguments:
#module.py something /user/peter/destination will result in directories:
#destination/abc
#destination/ccc
#To be created, and after that symbolic links will be created:
@piotrpalek
piotrpalek / boot2docker.md
Last active August 29, 2015 14:05
Install Boot2Docker with VirtualBox guest additions
  1. Go to http://boot2docker.io/ and install boot2docker for your system.
  2. Run boot2docker init from the command line.
  3. Install the custom boot2docker image (with guest additions): curl http://static.dockerfiles.io/boot2docker-v1.2.0-virtualbox-guest-additions-v4.3.14.iso > ~/.boot2docker/boot2docker.iso
  4. Share /Users with the docker vm: VBoxManage sharedfolder add boot2docker-vm -name home -hostpath /Users
  5. You can start docker with: boot2docker up
  6. This should work now (list your /Users directory): boot2docker ssh "ls /Users"
@piotrpalek
piotrpalek / rAF.js
Last active August 29, 2015 14:05 — forked from paulirish/rAF.js
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
this.route("company", function(){
this.route("index", { path: "/" }, function(){
this.route("show", { path: "/:company_id"});
});
this.route("users". { path: "/:company_id/users"})
});
@piotrpalek
piotrpalek / application.controller.js
Last active June 9, 2016 15:06
setter since 1.13
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
actions: {
updateAttr() {
this.set('otherattr', Math.random());
}
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
actions: {
updateAttr() {
this.set('otherattr', Math.random());
}
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
bodyFlag: false,
actions: {
swapBody() {
let body = '';
if(this.get('bodyFlag')) {
body = '<h1>Some body!!!</h1>';
@piotrpalek
piotrpalek / application.template.hbs
Last active December 22, 2015 17:03
New Twiddle
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
<br>
<br>
@piotrpalek
piotrpalek / application.template.hbs
Last active December 22, 2015 17:08
New Twiddle
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
<br>
<br>
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});