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
@pzuraq
pzuraq / autotracking.js
Last active December 13, 2023 22:57
Autotracking Simplified
// The global revision clock. Every time state changes, the clock increments.
let $REVISION = 0;
// The current dependency tracker. Whenever we compute a cache, we create a Set
// to track any dependencies that are used while computing. If no cache is
// computing, then the tracker is null.
let CURRENT_TRACKER = null;
// Storage represents a root value in the system - the actual state of our app.
class Storage {
@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;
}
//How to use
<Pagination
@count={{@model.typefaces.meta.count}}
@current={{this.page}}
@perPage={{this.commonData.perPage}}
@model={{@model.entity.slug}}
/>
<Pagination
class FetchTask {
@tracked isLoading = true;
@tracked result;
constructor(url) {
this.run(url);
}
async run(url) {
let response = await fetch(url);
@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
# }
@spajak
spajak / mpeg2mkv-steps.ps1
Last active February 29, 2024 20:35
Convert/rip DVD to MKV. Encode to MPEG-4 & merge into MKV - all without GUI, only command line tools
# My steps to:
# Convert DVD Video to MPEG-4 in MKV without GUI, using only CLI (Command Line Interface) tools.
# No need for MeGUI, Avisynth, Handbrake etc..
# ------------------------------------------------------------------------------
# Tools needed: `mediainfo`, `ffmpeg` & `ffprobe`, `x264`, `mkvmerge`, `mplayer` (optional).
# Google for them. Use latest versions. Windows tip: avoid Cygwin and get
# the official builds, x64, when possible.
# Before start use `mediainfo` & `ffprobe` and note down informations about the source material:
@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'],
@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;
@caseywatts
caseywatts / 0 README.md
Last active June 1, 2018 22:18
d3 & c3 npm shim to es6 module for Ember