Skip to content

Instantly share code, notes, and snippets.

Kamil Ogórek kamilogorek

Block or report user

Report or block kamilogorek

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kamilogorek
kamilogorek / hub-commits.sh
Last active Aug 29, 2015
Hub Workflow Snippets
View hub-commits.sh
$ git remote add <username> <fork-url>
$ git fetch <username>
$ git checkout <PR-branch-name>
@kamilogorek
kamilogorek / quicksort.js
Last active Aug 29, 2015
Quicksort on 1.000.000 random elements within 0 – 1.000.000 range
View quicksort.js
/**
* Quicksort implementation by Nicholas C. Zakas
* http://www.nczonline.net/blog/2012/11/27/computer-science-in-javascript-quicksort/
*/
var items = [];
for (var i = 0; i < 1000000; i++) {
items.push(Math.round(Math.random() * 1000000));
}
View notify-collection.js
var Collection = require("ampersand-rest-collection");
var Model = require("ampersand-model");
var Product = Model.extend({
props: {
name: 'string',
price: 'integer'
}
});
@kamilogorek
kamilogorek / index.js
Created Aug 20, 2014
requirebin sketch
View index.js
var AmpersandModel = require('ampersand-model');
var AmpersandCollection = require('ampersand-collection');
var AmpersandView = require('ampersand-view');
var Note = AmpersandModel.extend({
props: {
text: 'string'
}
});
@kamilogorek
kamilogorek / index.js
Created Aug 21, 2014
requirebin sketch
View index.js
var AmpersandState = require('ampersand-state');
var State = AmpersandState.extend({
props: {
name: 'string'
},
derived: {
awesomeName: {
deps: ['name'],
fn: function () {
View test.js
var object = {
method: function () {
console.log('foo');
},
method2: function () {
$('.button').on('click', function () {
this.method();
}.bind(this));
}
@kamilogorek
kamilogorek / index.js
Created Nov 4, 2014
requirebin sketch
View index.js
var AmpersandView
= require('ampersand-view');
var Foo = AmpersandView.extend({
autoRender: true,
initialize: function () {
this.template = '<span></span>';
}
});
@kamilogorek
kamilogorek / index.js
Created Nov 7, 2014
requirebin sketch
View index.js
// example using the raf module from npm. try changing some values!
var requestAnimationFrame = require("raf")
var canvas = document.createElement("canvas")
canvas.width = 500
canvas.height = 500
document.body.appendChild(canvas)
var context = canvas.getContext("2d")
@kamilogorek
kamilogorek / index.js
Last active Aug 29, 2015
requirebin sketch
View index.js
var AmpersandState = require('ampersand-state');
var AmpersandView = require('ampersand-view');
var domready = require('domready');
var MealView = AmpersandView.extend({
template: '<span data-hook="desc"></span>',
bindings: {
'model.description': {
type: 'text',
hook: 'desc'
@kamilogorek
kamilogorek / index.js
Created Nov 7, 2014
requirebin sketch
View index.js
var AmpersandState = require('ampersand-state');
var AmpersandView = require('ampersand-view');
var domready = require('domready');
var MealView = AmpersandView.extend({
template: '<span data-hook="desc"></span>',
bindings: {
'model.description': {
type: 'text',
hook: 'desc'
You can’t perform that action at this time.