Skip to content

Instantly share code, notes, and snippets.

View lifeart's full-sized avatar
🐹
Working from home

Alex Kanunnikov lifeart

🐹
Working from home
View GitHub Profile
@maxfierke
maxfierke / cancelable-fetch.js
Last active April 21, 2022 18:15
cancelableFetch Yieldable ember-concurrency
import { Yieldable } from 'ember-concurrency';
import fetch from 'fetch'; // i.e. ember-fetch. could also use native fetch too.
class FetchYieldable extends Yieldable {
constructor(url, opts = {}) {
super(...arguments);
this.url = url;
this.opts = opts;
}
@Alonski
Alonski / application.hbs
Created February 19, 2020 20:52
Ember.JS Ember Animated Route Transition Animations
<AnimatedOrphans />{{outlet}}
@dcramer
dcramer / .zshrc
Last active April 5, 2021 20:37
zsh
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
source <(antibody init)
antibody bundle < ~/.config/zsh_plugins
# TODO(dcramer): literally doesnt work at all
# function update_antibody() {
# antibody bundle < ~/.config/zsh_plugins > ~/.config/zsh_plugins.sh
# }
//How to use
<Pagination
@count={{@model.typefaces.meta.count}}
@current={{this.page}}
@perPage={{this.commonData.perPage}}
@model={{@model.entity.slug}}
/>
<Pagination
@lukemelia
lukemelia / 1-summary.md
Last active July 2, 2020 19:41
Simple component theming with broccoli.js

My team and I have been working on a new internal component library to share across a few Ember apps. The library is an Ember addon in a private github repo. So far, so good. The off-the-beaten-path part of our requirements is that the components need to be themeable. Specifically, we support a color and a "light" or "dark" aesthetic.

We want a great developer experience for creating and updating these components, so we used ember-freestyle as a devDependency of the library to create a living style guide. We added some UI to allow theme switching and even a checkbox to switch themes every second (thanks ember-concurrency!).

The thing that gave us the biggest challenge was figuring out how to author and apply the styles that were necessarily dynamic. Specifically, the css rules that used the dynamic color.

We decided to organize our styles like so:

app/styles/components/
class FetchTask {
@tracked isLoading = true;
@tracked result;
constructor(url) {
this.run(url);
}
async run(url) {
let response = await fetch(url);
#include <vector>
#include <iostream>
#include <cmath>
using namespace std;
#define EPSILON 1.0e-5
#define RESOLUTION 32
class Point2D
@lifeart
lifeart / readme.md
Last active June 13, 2018 15:43
Ember relationships rollback
const { Model, belongsTo, hasMany } = DS;
import { alias } from '@ember/object/computed';
import RollbackMixin from '../../mixins/rollbackable';


export default Model.extend(RollbackMixin, {
    rollabackable: computed(function(){
        return {
 hasMany: ['items', 'users'],
@listochkin
listochkin / Ссылки-JSunderhood
Created May 31, 2015 13:49
Неделя jsunderhood. Все ссылки, которыми я с вами поделился
Неделя jsunderhood. Все ссылки, которыми я с вами поделился
http://blog.vjeux.com/2014/javascript/react-css-in-js-nationjs.html
http://bost.ocks.org/mike/algorithms/
http://cdn.mozilla.net/pdfjs/tracemonkey.pdf
http://confreaks.tv/videos/keeprubyweird14-opening-keynote
http://confreaks.tv/videos/rubyconf2014-the-social-coding-contract
http://eldar.djafarov.com/2013/11/reactjs-mixing-with-backbone/
http://ember.js/posts/animations-in-emberjs-with-liquidfire
http://frameworksdays.com/event/mk-listochkin-emberjs/participants
@pioh
pioh / core.scss
Last active February 22, 2018 23:32
webpack scss config
@import '~react-select/dist/react-select.css';
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
html {
font-size: 13px;