Skip to content

Instantly share code, notes, and snippets.

View khadorkin's full-sized avatar

Dima Khadorkin khadorkin

  • Mobile Roadie
  • Vilnius, Lithuania
  • 14:37 (UTC +03:00)
View GitHub Profile
@khadorkin
khadorkin / index.js
Created October 19, 2017 23:17 — forked from cereallarceny/index.js
Server-side rendering with create-react-app (Fiber), React Router v4, Helmet, Redux, and Thunk
// Ignore those pesky styles
require('ignore-styles');
// Set up babel to do its thing... env for the latest toys, react-app for CRA
require('babel-register')({
ignore: /\/(build|node_modules)\//,
presets: ['env', 'react-app']
});
// Now that the nonsense is over... load up the server entry point
@khadorkin
khadorkin / index.html
Created December 26, 2017 13:50 — forked from mourner/index.html
Mapbox GL JS Puppeteer benchmark
<!doctype html>
<meta charset="utf-8">
<title>Benchmark</title>
<body></body>
<style>html, body, #map { height: 100%; margin: 0; } </style>
<div id="map"></div>
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.40.0/mapbox-gl.js'></script>
<!-- <script src="mapbox-gl.js"></script> -->
@khadorkin
khadorkin / sketch-loader.js
Created January 31, 2018 08:09 — forked from JoelBesada/sketch-loader.js
Webpack Sketch Loader
const JSZip = require('jszip')
const { parseBuffer } = require('bplist-parser')
const { isObject, each, find } = require('lodash')
const parseArchivedValue = value => {
return parseBuffer(new Buffer(value, 'base64'))
}
const parseArchivedString = obj => {
const { $objects } = parseArchivedValue(
@khadorkin
khadorkin / Python SimpleHTTPServer with SSL
Created February 12, 2018 14:01 — forked from rozifus/Python SimpleHTTPServer with SSL
Python SimpleHTTPServer with SSL
# useful for running ssl server on localhost
# which in turn is useful for working with WebSocket Secure (wss)
# copied from http://www.piware.de/2011/01/creating-an-https-server-in-python/
@khadorkin
khadorkin / ssl.sh
Created February 12, 2018 14:46 — forked from huozhi/ssl.sh
generate ssl keys for localhost
openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout key.pem -out cert.pem
# only enter the Common Name: your ip address or your domain name
<script>
// fbAsyncInit
// http://developers.facebook.com/docs/reference/javascript/FB.getLoginStatus/
window.fbAsyncInit = function() {
// init the FB JS SDK
FB.init({
appId: '<?php echo(FB_APP_ID); ?>',
status: true,
cookie: true,
xfbml: true,
import React, { Component, createContext } from 'react'
function initStore(store) {
const Context = createContext();
class Provider extends React.Component {
constructor() {
super();
this.state = store.initialState;
}
@khadorkin
khadorkin / App.js
Created May 27, 2018 20:23 — forked from sconstantinides/App.js
Sample Firebase task app
import React, { Component } from 'react';
import firebase from '@firebase/app';
import firestore from './firestore'; // Code: https://gist.github.com/sconstantinides/546a48ba183b1234f750ca6261440199
class App extends Component {
constructor(props) {
super(props);
this.state = {
userId: localStorage.getItem('userId') || '',
@khadorkin
khadorkin / rn-cli.config.js
Created June 15, 2018 22:47 — forked from ndbroadbent/rn-cli.config.js
React Native CLI config
const path = require('path')
const sharedBlacklist = []
const platformBlacklists = {
ios: [
'.web.js',
'.macos.js',
/node_modules\/react-native-web\/.*/,
/node_modules\/react-native-windows\/.*/,
@khadorkin
khadorkin / GitCommitEmoji.md
Created September 11, 2018 13:20 — forked from parmentf/GitCommitEmoji.md
Git Commit message Emoji