Skip to content

Instantly share code, notes, and snippets.

View TRomesh's full-sized avatar
👊
Win or Learn

Tharaka Romesh TRomesh

👊
Win or Learn
View GitHub Profile
import express from 'express';
import axios from 'axios';
import multer from 'multer';
const app = express();
/**
... express.js boilerplate
routes, middlewares, helpers, loggers, etc
**/
@abury
abury / routes.js
Last active February 21, 2018 03:41
PlainRoute example with require auth for React-redux
// We only need to import the modules necessary for initial render
import CoreLayout from '../layouts/CoreLayout/CoreLayout';
import Home from './Home';
import LoginRoute from './Login';
import SignupRoute from './Signup';
import DashboardRoute from './Secure/Dashboard';
import LeadsRoute from './Secure/Leads';
import NotFound from './NotFound';
/* Note: Instead of using JSX, we recommend using react-router
// Redux action
export function uploadSuccess({ data }) {
return {
type: 'UPLOAD_DOCUMENT_SUCCESS',
data,
};
}
export function uploadFail(error) {
return {
@Globegitter
Globegitter / es.sh
Last active November 18, 2020 12:52
Easy install for elasticsearch on Ubuntu 14.04
cd ~
##If you want to install OpenJDK
#sudo apt-get update
#sudo apt-get install openjdk-8-jre-headless -y
###Or if you want to install Oracle JDK, which seems to have slightly better performance
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
@vbalnt
vbalnt / cuda-ubuntu.md
Last active March 29, 2021 09:58
Installation of CUDA & Tensorflow in Ubuntu 14.04 or 16.04
@balupton
balupton / README.md
Last active June 7, 2021 16:00
Node.js Best Practice Exception Handling
/**
* This method displays the given quantity value on the screen.
*/
private void displayPrice(int number) {
TextView priceTextView = (TextView) findViewById(R.id.price_text_view);
priceTextView.setText(NumberFormat.getCurrencyInstance().format(number));
}
/** @jsx React.DOM */
var MyComponent = React.createClass({
getInitialState: function() {
// set up the initial state. used for "logical" initialization code
return {perMinute: '-', perDay: '-'};
},
componentDidMount: function() {
// fired only once, when the component is added to the DOM
// used for initialization code that has "side effects" i.e. i/o, jquery plugins, etc
var socket = io.connect(this.props.url);
@richardtape
richardtape / install-oh-my-zsh-on-ubuntu
Created August 4, 2014 01:58
Install Oh My ZSH on Ubuntu 14.04
# Where is the location of your current shall. Useful if we need to revert
echo $0
# Install ZSH
sudo apt-get install zsh
# Instal GIT
sudo apt-get install git-core
# Install OhMyZSH