(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
import React from "react" | |
import { Route, Switch } from "react-router-dom" | |
const AppRoute = ({ component: Component, layout: Layout, ...rest }) => ( | |
<Route {...rest} render={props => ( | |
<Layout> | |
<Component {...props} /> | |
</Layout> | |
)} /> | |
) |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Listen for XDebug - Remote", | |
"type": "php", | |
"request": "launch", | |
"port": 9000, | |
"pathMappings": { | |
"/var/www/html/your_app_on_server": "${workspaceFolder}", |
Initially, I found bitmasking to be a confusing concept and found no use for it. So I've whipped up this code snippet in case anyone else is confused: | |
<?php | |
// The various details a vehicle can have | |
$hasFourWheels = 1; | |
$hasTwoWheels = 2; | |
$hasDoors = 4; | |
$hasRedColour = 8; |
#!/usr/bin/env node | |
// todo: try to require jshint here, instead of spawning process, then fallback to spawning process. | |
var jshint = nrequire('jshint'); | |
if (jshint) return process.exit(0); | |
// jshint not installed locally, spawn process instead. | |
// basically the same, but less pretty. | |
var exec = require('child_process').exec; |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
module OS | |
def OS.windows? | |
(/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil | |
end | |
def OS.mac? | |
(/darwin/ =~ RUBY_PLATFORM) != nil |
Regex for matching ALL Japanese common & uncommon Kanji (4e00 – 9fcf) ~ The Big Kahuna! | |
([一-龯]) | |
Regex for matching Hirgana or Katakana | |
([ぁ-んァ-ン]) | |
Regex for matching Non-Hirgana or Non-Katakana | |
([^ぁ-んァ-ン]) | |
Regex for matching Hirgana or Katakana or basic punctuation (、。’) |
# good git book | |
http://git-scm.com/book | |
# Discard uncommitted changes in a specific file | |
git checkout file_name | |
# Clear everything not in repo | |
git checkout -- . | |
# A way to quickly move to the previous commit in a git branch. This also way for "deleting" last commit. |
require "iconv" | |
encoding = "SHIFT-JIS" | |
# Open a file for writing in the Shift-JIS format | |
File.open("output.csv", "w:#{encoding}") do |io| | |
# Read the CSV file, and convert CRs to CRLFs. | |
csv = File.open("input.csv").read.gsub("\r", "\r\n") | |
# Convert the CSV to the correct encoding | |
io.write Iconv.iconv(encoding, "UTF-8", csv).join | |
end |