Skip to content

Instantly share code, notes, and snippets.

View linmic's full-sized avatar

Linmic linmic

View GitHub Profile
@linmic
linmic / .gitignore
Created January 15, 2018 01:42 — forked from amoslanka/.gitignore
Simple session-stored auth on Node.js
*node_modules/
.DS_Store
// (c) Netflix UI Engineering
// https://www.youtube.com/watch?v=V8oTJ8OZ5S0
// window.performance.timing
// time to Interactive (TTI)
// domInteractive - requestStart
function getTimeToInteractive() {
const requestStart = window.performance.timing.requestStart;
const domInteractive = window.performance.timing.domInteractive;
@linmic
linmic / preset.scss
Last active September 28, 2017 01:27
body {
...
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-rendering: optimizeLegibility;
...
}
/* do this instead */
#wrapper {
#wrapper {
.component {
color: red;
}
}
/* jsx
import styles from './App.scss';
<div id={styles.wrapper} /> // yes, you can do this
@linmic
linmic / MySQL_macOS_Sierra.md
Created August 13, 2017 16:58 — forked from nrollr/MySQL_macOS_Sierra.md
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

jest.mock('../App');
import React from 'react';
import { Provider } from 'react-redux';
import { mount } from 'enzyme';
import App from '../App';
import AppContainer from '../AppContainer';
const storeFake = state => {
return {
import { connect } from 'react-redux';
import { load } from '../redux/modules/search';
import App from './App';
const mapStateToProps = state => ({
users: state.users,
auth: state.auth,
config: state.config,
});
@linmic
linmic / combinations.js
Created November 22, 2016 13:00 — forked from axelpale/combinations.js
JavaScript functions to calculate combinations of elements in Array.
/**
* Copyright 2012 Akseli Palén.
* Created 2012-07-15.
* Licensed under the MIT license.
*
* <license>
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
/*
* author: [email protected]
* license: MIT
*/
@mixin text-clamp($line-height, $lines, $bg-color: $gray-f1f1f1) {
position: relative;
height: $line-height * $lines;
display: block;
overflow: hidden;
#!/usr/bin/python2.7
PATH='./src/assets/'
import os, subprocess
for f in os.listdir(PATH):
name, ext = os.path.splitext(f)
if ext in ['.svg', '.png', '.jpg', '.ico']: