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
@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 :

@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,
@linmic
linmic / sanfrancisco-font.css
Created August 3, 2016 10:22
San Francisco Web Font
/**
* http://applemusic.tumblr.com/
* https://jsfiddle.net/xq56dmrh/
*/
/** Ultra Light */
@font-face {
font-family: "San Francisco";
font-weight: 100;
src: url("https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-ultralight-webfont.woff");
var d3 = require('d3');
var jsdom = require("jsdom-little");
var React = require('react-native');
var { View, Text } = React;
var Svg = require('./Svg');
var parseDate = d3.time.format("%d-%b-%y").parse;
var D3Chart = React.createClass({
componentDidMount() {

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
gulp = require('gulp');
lr = require('gulp-livereload');
gulp.task('watch', function() {
lr.listen()
dest = ["app/views/**","app/assets/**"];
gulp.watch(dest).on('change', function(file) {
lr.changed(file.path);
});
});
var opt = {
type: 'list',
title: 'keep burning',
message: 'Primary message to display',
priority: 1,
items: [{ title: '', message: ''}],
iconUrl:'../images/icon.png'
};
chrome.notifications.create('notify1', opt, function(id) { console.log("Last error:", chrome.runtime.lastError); });
@linmic
linmic / bluetooth.js
Last active August 29, 2015 14:06 — forked from revolunet/bluetooth.js
/*
Chrome Packaged app Bluetooth API test
Before interacting with a BT device, you need to :
1) get the device MAC and service UUID with startDiscovery and getServices methods
2) request permission with chrome.permissions.request
3) add the service profile with chrome.bluetooth.addProfile (a profile is only {uuid:'xxxxxxx...'})
*/
// onConnection callback
chrome.bluetooth.onConnection.addListener(
<html>
<head>
<script src="https://apis.google.com/js/client.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script>
function auth() {
var config = {
'client_id': 'OAUTH_CLIENT_ID',
'scope': 'https://www.google.com/m8/feeds'
};