Skip to content

Instantly share code, notes, and snippets.

View raidenz's full-sized avatar

raidenz raidenz

View GitHub Profile
@raidenz
raidenz / EmbeddedGist.js
Created January 30, 2017 02:27
react embed gist
var EmbeddedGist = React.createClass({
propTypes: {
gist: React.PropTypes.string.isRequired, // e.g. "username/id"
file: React.PropTypes.string // to embed a single specific file from the gist
},
statics: {
// Each time we request a Gist, we'll need to generate a new
// global function name to serve as the JSONP callback.
gistCallbackId: 0,
@raidenz
raidenz / gitflow-breakdown.md
Last active July 10, 2017 05:32 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
x git commit --allow-empty -m "Initial commit"
x git checkout -b develop master

Connect to the remote repository

@raidenz
raidenz / README.md
Created April 22, 2017 11:30 — forked from Dr-Nikson/README.md
Auth example (react + redux + react-router)
@raidenz
raidenz / sync.js
Created May 1, 2017 16:41
coroutines
var co = require('co');
var proc = require('child_process')
function exec(command) {
var p = new Promise(function (resolve, reject) {
proc.exec(command, function (err, stdout, stderr) {
if (err) {
console.log(stderr);
} else {
console.log(stdout)
@raidenz
raidenz / express-server-side-rendering.md
Created May 6, 2017 16:30 — forked from joepie91/express-server-side-rendering.md
Rendering pages server-side with Express (and Pug)

Terminology

  • View: Also called a "template", a file that contains markup (like HTML) and optionally additional instructions on how to generate snippets of HTML, such as text interpolation, loops, conditionals, includes, and so on.
  • View engine: Also called a "template library" or "templater", ie. a library that implements view functionality, and potentially also a custom language for specifying it (like Pug does).
  • HTML templater: A template library that's designed specifically for generating HTML. It understands document structure and thus can provide useful advanced tools like mixins, as well as more secure output escaping (since it can determine the right escaping approach from the context in which a value is used), but it also means that the templater is not useful for anything other than HTML.
  • String-based templater: A template library that implements templating logic, but that has no understanding of the content it is generating - it simply concatenates together strings, potenti
@raidenz
raidenz / tager.sh
Last active December 14, 2019 20:43
ceate tool for git tag
#!/bin/bash
#get highest tag number
VERSION=`git describe --abbrev=0 --tags`
# get version from node
# PACKAGE_VERSION=$(node -p -e "require('./package.json').version")
#replace . with space so can split into an array
VERSION_BITS=(${VERSION//./ })
@raidenz
raidenz / README.md
Created February 21, 2018 02:47
Sequelize + Express + Migrations + Seed Starter
@raidenz
raidenz / componenttype.txt
Last active August 18, 2018 06:56
:medium: react component type
╔════════════════╦═══════════════════╗
║ smart componen ║ dumb component ║
╠════════════════╬═══════════════════╣
║ statefull ║ Stateless ║
╠════════════════╬═══════════════════╣
║ container ║ functional ║
╚════════════════╩═══════════════════╝
@raidenz
raidenz / SmartComponent.jsx
Last active August 18, 2018 07:06
:medium: smart component
import React from 'react'
class Statefull extends React.Component {
constructor(props){
super(props)
this.state={
name: ''
}
}
handleChange = (e) => {
@raidenz
raidenz / DumbComponent.jsx
Last active August 18, 2018 07:04
:medium: Dumb Compenent
import React from 'react'
const Name = (props) => {
return(
<div>
dumb Component
<div>
name: {props.name}
</div>
<input name="name" value={props.name} onChange={props.handleChange}/>