Skip to content

Instantly share code, notes, and snippets.

View ehrudxo's full-sized avatar

@iam_keen on twitter ehrudxo

View GitHub Profile
@ehrudxo
ehrudxo / BigPicture.md
Last active March 12, 2017 12:19
Deep Learning
@ehrudxo
ehrudxo / cli-spinnesr.js
Created October 5, 2016 01:13
cli spinners
//this source is from cli-spinners
"dots": {
"interval": 80,
"frames": [
"⠋",
"⠙",
"⠹",
"⠸",
"⠼",
"⠴",
@ehrudxo
ehrudxo / DateRangePicker.jsx
Created August 21, 2016 22:15
DatePicker from airbnb
//https://github.com/airbnb/react-dates/blob/master/examples/DateRangePickerWrapper.jsx
import React from 'react';
import DateRangePicker from '../src/components/DateRangePicker';
class DateRangePickerWrapper extends React.Component {
constructor(props) {
super(props);
this.state = {
focusedInput: null,
@ehrudxo
ehrudxo / server.js
Created August 15, 2016 21:22
webpack-dashboard json
/* eslint-disable no-var, strict */
'use strict';
var webpack = require('webpack');
var WebpackDevServer = require('webpack-dev-server');
var config = require('./webpack.config');
/*
start webpack-dev-server
*/
new WebpackDevServer(webpack(config), {
@ehrudxo
ehrudxo / sharingbutton.io.js
Last active August 3, 2016 15:12
sharingbutton
// This source if from https://github.com/mxstbr/sharingbuttons.io/blob/master/js/stores/AppStore.js
_updateLinks: function() {
var text = encodeURIComponent(_data.text);
var url = encodeURIComponent(_data.url);
var links = {
'facebook': 'https://facebook.com/sharer/sharer.php?u=' + url,
'twitter': 'https://twitter.com/intent/tweet/?text=' + text + '&url=' + url,
'google': 'https://plus.google.com/share?url=' + url,
'tumblr': "https://www.tumblr.com/widgets/share/tool?posttype=link&title=" + text + "&caption=" + text + "&content=" + url + "&canonicalUrl=" + url + "&shareSource=tumblr_share_button",
@ehrudxo
ehrudxo / autobind.js
Created July 27, 2016 09:08
is from create-react
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
class App extends Component {
constructor(props){
super(props);
this.handleClick = this.handleClick.bind(this);
}
handleClick(){
@ehrudxo
ehrudxo / lifecycleofReact.js
Created July 10, 2016 12:49
React Life Cycle
var isLoaded=false;
var LifeCycle = React.createClass({
getInitialState(){
$('#output').append("getInitialState\n");
return{
childFoobar: false
};
},
getDefaultProps(props){
@ehrudxo
ehrudxo / timeline.swift
Created July 6, 2016 14:54
time line swift
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
self.configureView()
self.timeline();
}
func timeline(){
let frame = CGRectMake(0, 20, 480, 640)
let timeline = ISTimeline(frame: frame)
@ehrudxo
ehrudxo / ReactJS.js
Last active July 3, 2016 14:35
React SVG Sample
function SVGElementClass(){
function SVGClass(){
return(
<svg version="1.0" xmlns="http://www.w3.org/2000/svg" width="163.000000pt" height="165.000000pt" viewBox="0 0 163.000000 165.000000" preserveAspectRatio="xMidYMid meet">
<g transform="translate(0.000000,165.000000) scale(0.100000,-0.100000)" fill="#FFFFFF" stroke="none">
<path d="M110 830 l0 -710 710 0 710 0 0 710 0 710 -710 0 -710 0 0 -710z m1360 0 l0 -650 -650 0 -650 0 0 650 0 650 650 0 650 0 0 -650z"/>
<path d="M314 832 c-30 -20 -19 -82 15 -82 29 0 46 36 32 66 -11 24 -27 30 -47 16z"/>
<path d="M1320 826 c-15 -19 -9 -56 12 -69 34 -22 66 41 36 71 -16 16 -33 15 -48 -2z"/>
<path d="M657 692 c-9 -13 20 -83 45 -109 12 -14 35 -31 50 -39 35 -18 119 -18 162 0 42 18 85 73 93 120 5 33 4 36 -20 36 -20 0 -28 -7 -37 -34 -23 -72 -102 -105 -172 -72 -34 17 -68 61 -68 90 0 16 -44 23 -53 8z"/>
</g>
@ehrudxo
ehrudxo / airbnb-react.js
Created July 3, 2016 14:29
some part of airbnb react style guide
// bad
const Listing = React.createClass({
// ...
render() {
return <div>{this.state.hello}</div>;
}
});
// good
class Listing extends React.Component {