Skip to content

Instantly share code, notes, and snippets.

@sato-shi
sato-shi / localhost-ssl-certificate.md
Created May 29, 2018 20:11 — forked from ethicka/localhost-ssl-certificate.md
Localhost SSL Certificate on Mac OS Sierra and High Sierra

This gives you that beautiful green lock in Chrome. I'm assuming you're putting your SSL documents in /etc/ssl, but you can put them anywhere and replace the references in the following commands. Tested successfully on Mac OS Sierra and High Sierra.

Set up localhost.conf

sudo nano /etc/ssl/localhost/localhost.conf

Content:

[req]
@sato-shi
sato-shi / localhost-ssl-certificate.md
Created May 29, 2018 20:11 — forked from ethicka/localhost-ssl-certificate.md
Localhost SSL Certificate on Mac OS Sierra and High Sierra

This gives you that beautiful green lock in Chrome. I'm assuming you're putting your SSL documents in /etc/ssl, but you can put them anywhere and replace the references in the following commands. Tested successfully on Mac OS Sierra and High Sierra.

Set up localhost.conf

sudo nano /etc/ssl/localhost/localhost.conf

Content:

[req]
@sato-shi
sato-shi / Object Flatten
Created August 15, 2017 07:02 — forked from penguinboy/Object Flatten
Flatten javascript objects into a single-depth object
var flattenObject = function(ob) {
var toReturn = {};
for (var i in ob) {
if (!ob.hasOwnProperty(i)) continue;
if ((typeof ob[i]) == 'object') {
var flatObject = flattenObject(ob[i]);
for (var x in flatObject) {
if (!flatObject.hasOwnProperty(x)) continue;
@sato-shi
sato-shi / README.md
Created September 1, 2016 20:33 — forked from SNagappan/README.md
bAbI

##Model

This is an implementation of Facebook's baseline GRU/LSTM model on the bAbI dataset Weston et al. 2015. It includes an interactive demo.

The bAbI dataset contains 20 different question answering tasks.

Model script

The model training script train.py and demo script demo.py are included below.

Instructions

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() {
@sato-shi
sato-shi / fp-lingo.md
Created January 3, 2016 07:57 — forked from ericelliott/fp-lingo.md
A Guide to Functional Programming Lingo for JavaScripters

A Guide to Functional Programming Lingo for JavaScripters

Functional programming gets a bad wrap about being too hard for mere mortals to comprehend. This is nonsense. The concepts are actually quite simple to grasp.

The jargon is the hardest part. A lot of that vocabulary comes from a specialized field of mathematical study called category theory (with a liberal sprinkling of type theory and abstract algebra). This sounds a lot scarier than it is. You can do this!

All examples using ES6 syntax. wrap (foo) => bar means:

function wrap (foo) {
@sato-shi
sato-shi / frp.md
Created December 29, 2015 09:39 — forked from ohanhi/frp.md
Learning FP the hard way: Experiences on the Elm language

Learning FP the hard way: Experiences on the Elm language

by Ossi Hanhinen, @ohanhi

with the support of Futurice 💚.

Licensed under CC BY 4.0.

Foreword

@sato-shi
sato-shi / keyframe.js
Created November 27, 2015 09:55 — forked from pgarciacamou/keyframe.js
Allows to create a set of keyframes with javascript and inject it to a stylesheet.
var Keyframe = (function (){
var keyframePrefix = (function getKeyframePrefix(){
var t, el = document.createElement("fakeelement")
,animations = {
"animation": "",
"OAnimation": "-o-",
"msAnimation": "-ms-",
"MozAnimation": "-moz-",
"WebkitAnimation": "-webkit-"
};
@sato-shi
sato-shi / animation.js
Created November 27, 2015 09:55 — forked from pgarciacamou/animation.js
Animation Detector. Watches for the end of and animation to execute a callback and on start you can add the proper classes to start the animation.
var Animation = (function (){
var animationEvent = (function whichAnimationEvent(){
var t, el = document.createElement("fakeelement")
,animation = null
,animations = {
"WebkitAnimation": "webkitAnimationEnd",
"MozAnimation": "animationend",
"OAnimation": "oAnimationEnd",
"animation": "animationend"
};
@sato-shi
sato-shi / detect-pesudo-animation.js
Created November 27, 2015 07:20 — forked from chuyik/detect-pesudo-animation.js
Detect CSS Animation support on :before :after pseudo-elements with javascript
/**
* Inspired from:
* http://davidwalsh.name/pseudo-element-animation
* http://stackoverflow.com/a/1016701/3828891
*/
var addCssRule = function(selector, rule) {
if (document.styleSheets) {
if (!document.styleSheets.length) {
var head = document.getElementsByTagName('head')[0];
head.appendChild(document.createElement('style'));