Skip to content

Instantly share code, notes, and snippets.

View Dremora's full-sized avatar

Kirill Korolyov Dremora

View GitHub Profile

Keybase proof

I hereby claim:

  • I am dremora on github.
  • I am dremora (https://keybase.io/dremora) on keybase.
  • I have a public key whose fingerprint is 9099 1B2A F23B 6BBD 3B4E FE65 7C95 050F F386 9535

To claim this, I am signing this object:

import Ember from 'ember';
export default Ember.Component.extend({
repositionStickyEditor: function () {
let top = -$(window).scrollTop();
$('.sticky').css('transform', `translateY(${top <= 84 ? 8- top : 0}px) translateZ(0)`)
// this.repositionStickyEditor();
// });
}.on('didInsertElement'),

Text

  • font-family
  • font-size
  • font-style
  • font-variant
  • font-weight
  • font
  • letter-spacing
  • line-height
  • white-space
@Dremora
Dremora / controllers.index.js
Last active April 22, 2016 18:28
New Twiddle
import Ember from 'ember';
export default Ember.Controller.extend({
actions: {
redirectToFoo() {
this.transitionToRoute('foo');
}
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
actions: {
change() {
}
}
});
@Dremora
Dremora / time.elm
Last active October 8, 2016 19:02
Types and functions for working with time
type Date
type Time
type Timestamp
type Timezone = System | UTC | TimezoneData ...
type IntervalUnit = Millisecond | Second | Minute | Hour | Day | Month | Year
type Interval
type Locale
type Format
@Dremora
Dremora / components.my-component.js
Created January 23, 2017 15:09
Event bubbling in integration tests
import Ember from 'ember';
export default Ember.Component.extend({
clicked: 0,
actions: {
clicked() {
this.set('clicked', this.get('clicked') + 1);
}
}
@Dremora
Dremora / Dockerfile
Last active April 10, 2017 13:12
Techbikers Dockerfile
FROM python:2.7
ADD . /app
WORKDIR /app
RUN pip install -r requirements.txt
RUN cp server/settings/local.py.skel server/settings/local.py
RUN sed -i "s/ALLOWED_HOSTS = \[\]/ALLOWED_HOSTS = ['localhost']/g" server/settings/local.py
RUN SECRET_KEY=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1); sed -i "s/SECRET_KEY = ''/SECRET_KEY = '$SECRET_KEY'/g" server/settings/local.py
RUN mkdir logs
// @flow
import React, { Component, type Node } from 'react';
import PropTypes from 'prop-types';
type RenderFn<T> = (value: T) => Node;
export type ProviderProps<T> = {
value: T,
children?: Node
};
@Dremora
Dremora / typescript-json-decoder-example.ts
Last active March 29, 2020 20:36
typescript-json-decoder
import { Decoder, array, decode, lazy, object, oneOf, string } from "./typescript-json-decoder";
type TreeEntry = string | { name: string; contents: TreeRoot };
type TreeRoot = TreeEntry[];
function getTreeEntryDecoder(): Decoder<TreeEntry> {
return oneOf<TreeEntry>(
string,
object({ contents: lazy(getTreeDecoder), name: string })
);