Skip to content

Instantly share code, notes, and snippets.

View emirotin's full-sized avatar
🏠
Working from home

Eugene Mirotin emirotin

🏠
Working from home
View GitHub Profile
@emirotin
emirotin / steps.md
Last active March 29, 2019 09:22
Build fts5-stemmer on Windows

Using fresh Win7 32bit

  • install git using the official installer https://git-scm.com/download/win
  • install Msys2 http://www.msys2.org/
  • open Msys bash, run pacman -Syu, then close the bash window
  • open again, run pacman -Su
  • open git bash, run ssh-keygen -t rsa -b 4096
  • copy the key, add to GitHub
  • from the git bash cd /c/Users/<your username>
  • git clone --recursive [email protected]:abiliojr/fts5-snowball.git
  • close git bash, open msys bash, cd /c/Users//fts5-snowball
@emirotin
emirotin / comp.scala
Created December 20, 2017 14:50
Compare Rationals
(a, b) => a.numer * b.denom - b.numer * a.denom
@emirotin
emirotin / get-config.js
Created June 13, 2017 10:18
create-react-app v1.3.1 unified webpack config
const getClientEnvironment = require('../env');
const paths = require('../paths');
module.exports = (isProd) => {
// Webpack uses `publicPath` to determine where the app is being served from.
// It requires a trailing slash, or the file assets will get an incorrect path.
// In development, we always serve from the root. This makes config easier.
const publicPath = isProd ? paths.servedPath : '/';
// `publicUrl` is just like `publicPath`, but we will provide it to our app
@emirotin
emirotin / build-webpack-config.js
Created April 14, 2017 17:05
create-react-app config for Webpack2
var autoprefixer = require('autoprefixer');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var ManifestPlugin = require('webpack-manifest-plugin');
var InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin');
var WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeModulesPlugin');
var getClientEnvironment = require('./env');
var paths = require('./paths');
const replace = (arr, i, newEl) => arr.map((el, k) => {
return k === i ? newEl : el
})
const replaceWhere = (arr, pred, transform) => arr.map((el, i) => {
return pred(el, i) ? transform(el, i) : el
})
const swap = (arr, i, j) => arr.map((el, k) => {
if (k === i) return arr[j]
function logText(text) {
const elPre = document.createElement('PRE')
const elCode = document.createElement('CODE')
elPre.innerHTML = text
elCode.appendChild(elPre)
document.body.appendChild(elCode)
}
var text = "\
page 1\n\
################################################
# Dockerfile to build panyabot container images
# Based on raspbian
################################################
#Set the base image to raspbian
FROM resin/raspberrypi-systemd:wheezy
# File Author / Maintainer
MAINTAINER Wachira Ndaiga
@emirotin
emirotin / SassMeister-input.scss
Last active March 9, 2016 11:21
Generated by SassMeister.com.
// ----
// Sass (v3.4.21)
// Compass (v1.0.3)
// ----
$unit: 1rem;
$phoneWindowWidth: 768;
$phoneMQ: "only screen and (max-width: #{$phoneWindowWidth * 1px})";
.formFooter {
@emirotin
emirotin / SassMeister-input.scss
Created March 9, 2016 11:16
Generated by SassMeister.com.
// ----
// Sass (v3.4.21)
// Compass (v1.0.3)
// ----
$unit: 1rem;
$phoneWindowWidth: 768;
.formFooter {
padding-top: 1 * $unit 0;
exports.getPlainOptions = ->
# a helper method can be provided by the repo to flatten the options list if the CLI needs it