Skip to content

Instantly share code, notes, and snippets.

View Lendar's full-sized avatar

Denis Elistratov Lendar

View GitHub Profile
@Lendar
Lendar / index.txt
Last active February 21, 2016 16:23
Uber landing reducers state
cities
city
config
estimates
experiments
job
jobs
languages
locale
location
@Lendar
Lendar / App.js
Last active October 22, 2021 20:38
Using FontFaceObserver for React app loader
import React from 'react'
import 'fontfaceobserver'
import IndexPage from './IndexPage'
import Loader from './Loader'
import { fetchUser } from '../apiclient'
import 'font-awesome-webpack'
import './Lato-font.css'
import './Roboto-font.css'
@Lendar
Lendar / redux-devtools-separate-window.js
Last active August 26, 2015 09:43 — forked from tlrobinson/redux-devtools-separate-window.js
Put the awesome redux-devtools in it's own window so it doesn't obscure or be obscured by your application
import React from 'react'
import { DevTools, DebugPanel, LogMonitor } from 'redux-devtools/lib/react'
export default function openDebugPanel (store) {
const width = 0.3 * screen.width
const left = 0.7 * screen.width - 5
const height = screen.height
const win = window.open(
null,
'redux-devtools',
@Lendar
Lendar / emojify.coffee
Last active August 29, 2015 14:14 — forked from thomasboyt/emoji.js
Emojify React Component
React = require 'react'
punycode = require 'punycode'
HOST = 'https://assets-cdn.github.com/images/icons/emoji/unicode/'
isEmojiCode = (charCode) ->
(charCode >= 0x1f300 and charCode <= 0x1f5ff) or
(charCode >= 0x1f600 and charCode <= 0x1f64f) or
(charCode >= 0x1f680 and charCode <= 0x1f6ff) or
(charCode >= 0x2600 and charCode <= 0x26ff) or
@Lendar
Lendar / client.js
Created August 24, 2012 20:18
patching HTML page with something else
var alien = document.createElement('html');
alien.innerHTML = '<html><head><title>The Page</title></head><body><h1>hi!</h1></body></html>';
document.head.innerHTML = alien.getElementsByTagName('head')[0].innerHTML;
document.body.innerHTML = alien.getElementsByTagName('body')[0].innerHTML;
@Lendar
Lendar / gist:2281616
Created April 2, 2012 08:21
c++ method pointer
class SomeClass {
public:
int SomeMethod(int i, int j) {
return i+j;
}
}
...
typedef int (SomeClass::*SomeMethodSig) (int, int);
...
{