Skip to content

Instantly share code, notes, and snippets.

@shinaisan
shinaisan / App.js
Last active October 27, 2017 14:28
Redux Form - Submit Validation Example
import React from 'react';
import SubmitValidationForm from './SubmitValidationForm';
import { createStore } from 'redux';
import { Provider } from 'react-redux';
import reducer from './reducers';
import submit from './submit'
import "bootstrap/dist/css/bootstrap.css";
const store = createStore(reducer);
@shinaisan
shinaisan / App.js
Last active October 26, 2017 13:48
Redux Form - Field-Level Validation Example
import React from 'react';
import FieldLevelValidationForm from './FieldLevelValidationForm';
import { createStore } from 'redux';
import { Provider } from 'react-redux';
import reducer from './reducers';
import "bootstrap/dist/css/bootstrap.css";
const store = createStore(reducer);
class App extends React.Component {
@shinaisan
shinaisan / App.js
Last active October 26, 2017 13:26
Redux Form - Synchronous Validation Example
import React from 'react';
import SyncValidationForm from './SyncValidationForm';
import { createStore } from 'redux';
import { Provider } from 'react-redux';
import reducer from './reducers';
import "bootstrap/dist/css/bootstrap.css";
const store = createStore(reducer);
class App extends React.Component {
@shinaisan
shinaisan / App.js
Last active October 25, 2017 14:14
Redux Form - Simple Form Example
import React from 'react';
import SimpleForm from './SimpleForm';
import { createStore } from 'redux';
import { Provider } from 'react-redux';
import reducer from './reducers';
import "bootstrap/dist/css/bootstrap.css";
const store = createStore(reducer);
class App extends React.Component {
@shinaisan
shinaisan / App.js
Last active October 25, 2017 13:46
Redux Form - Getting Started (with Bootstrap)
import React from 'react';
import ContactForm from './ContactForm';
import { createStore } from 'redux';
import { Provider } from 'react-redux';
import reducer from './reducers';
import "bootstrap/dist/css/bootstrap.css";
const store = createStore(reducer);
class App extends React.Component {
@shinaisan
shinaisan / App.js
Last active October 25, 2017 13:30
Redux Form - Getting Started
import React from 'react';
import ContactForm from './ContactForm';
import { createStore } from 'redux';
import { Provider } from 'react-redux';
import reducer from './reducers';
const store = createStore(reducer);
class App extends React.Component {
constructor(props) {
@shinaisan
shinaisan / rake_pathmap.rb
Created October 30, 2016 08:46
Rake pathmap example.
require 'rake'
SOURCE_FILES = Rake::FileList.new('src/**/*.txt')
TARGET_FILES = SOURCE_FILES.pathmap("%{^src/,out/}X.txt")
task :default => :copy_all
task :copy_all => TARGET_FILES
rule %r{^out/.+txt$} => '%{^out/,src/}X.txt' do |t|
d = t.name.pathmap("%d")
@shinaisan
shinaisan / .gitignore
Last active May 16, 2017 03:39
Node.js xmldom whitespace stripping sample
node_modules
@shinaisan
shinaisan / README.md
Created October 29, 2016 06:29
HTTP GET samples with node.js.

HTTP GET samples with node.js ...

  • using http.get.
  • using http.request.
  • using request.get.
@shinaisan
shinaisan / ontology.py
Created October 23, 2016 06:06
DBpedia Ontology Extraction
from rdflib import Graph
def ontology(file_name):
g = Graph()
index = file_name.rfind('.')
if index < 0:
return None
type = file_name[index + 1:]
g.parse(file_name, format = type)
prefix = 'http://dbpedia.org/ontology/'