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
View mealprep-recipes.md

Tortilla with chicken, cheese and veggies

Ingredients for 5 portions

  • Chicken breast 800g
  • Cheese 250g
  • Tortilla 625g (10pc)
  • Canned corn 250g
  • Bell peppers 250g
  • Onions 125g
View check-env.js
const env = process.env.NODE_ENV
const task = process.env.npm_lifecycle_event
const packageJSON = require('../package.json')
const availableEnvironments = Object.keys(packageJSON.scripts)
.filter(key => key.startsWith(task))
.map(key => key.split(':')[1])
.filter(key => key)
function displayMessage (message) {
console.error(`${'='.repeat(message.length)}\n${message}\n${'='.repeat(message.length)}`)
View sazerac.js
test(isPrime, () => {
given(1).expect(false)
given(2).expect(true)
given(3).expect(true)
given(4).expect(false)
})
// vs.
describe('isPrime()', () => {
View int-array-serializer.js
import Ember from 'ember';
export default Ember.Mixin.create({
serializeQueryParam(value, urlKey, defaultValueType) {
if (defaultValueType === 'array') {
return value;
} else {
return this._super.call(this, ...arguments);
}
},
@kamilogorek
kamilogorek / isSupportingCSSAnimations.js
Created Jul 28, 2015
isSupportingCSSAnimations function
View isSupportingCSSAnimations.js
function isSupportingCSSAnimations () {
var prefixes = ['Webkit', 'Moz', 'O', 'ms', 'Khtml'];
var el = document.createElement('div');
if (el.style.animationName !== undefined) {
return true;
}
return prefixes.some(function (prefix) {
return el.style[prefix + 'AnimationName'] !== undefined;
@kamilogorek
kamilogorek / index.js
Created May 27, 2015
requirebin sketch
View index.js
var AmpersandModel = require('ampersand-model');
var Model = AmpersandModel.extend({
props: {
name: 'string',
greetingType: ['string', true, 'long']
},
derived: {
greeting: {
deps: ['name', 'greetingType'],
@kamilogorek
kamilogorek / index.js
Created Feb 7, 2015
requirebin sketch
View index.js
var AmpersandView = require('ampersand-view');
var AppSubView = AmpersandView.extend({
template: '<button data-hook=someEvent>Triggerme</button>',
events: {
'click [data-hook=someEvent]': 'someEventHandler'
},
someEventHandler: function () {
console.log('you triggered me!');
this.parent.parentHandler();
@kamilogorek
kamilogorek / SassMeister-input.scss
Created Jan 20, 2015
Generated by SassMeister.com.
View SassMeister-input.scss
// ----
// Sass (v3.4.9)
// Compass (v1.0.1)
// ----
.btn {
color: red;
}
.add,
@kamilogorek
kamilogorek / index.js
Created Jan 15, 2015
requirebin sketch
View index.js
var Model = require('ampersand-model');
var View = require('ampersand-view');
var domready = require('domready');
var ChildModel = Model.extend({
props: {
id: 'number'
}
});
@kamilogorek
kamilogorek / index.js
Created Nov 27, 2014
requirebin sketch
View index.js
var State = require('ampersand-state');
var X = State.extend({
props: {
foo: 'number'
},
derived: {
bar: {
deps: ['foo'],
fn: function() { return this.foo + 1; }
}
You can’t perform that action at this time.