Skip to content

Instantly share code, notes, and snippets.

View daimagine's full-sized avatar

Adi Kurniawan daimagine

  • Bogor
View GitHub Profile
@daimagine
daimagine / LoginForm
Created June 27, 2015 17:35
React mixin with script loader
import React from 'react/addons';
import ReactMixin from 'react-mixin';
import ReactScriptLoaderMixin from 'react-script-loader';
export default class LoginForm extends React.Component {
constructor() {
super();
this.state = {
user: '',
password: '',
@daimagine
daimagine / nginx.conf
Created June 28, 2015 01:41
Nginx Configuration
user www;
worker_processes 1;
error_log /var/log/nginx/error.log;
pid /usr/local/etc/nginx/nginx.pid;
events {
worker_connections 1024;
}
<body class="error-body no-top breakpoint-480 pace-done">
<div class="pace pace-inactive">
<div class="pace-progress" data-progress-text="100%" data-progress="99" style="-webkit-transform: translate3d(100%, 0px, 0px); transform: translate3d(100%, 0px, 0px);">
<div class="pace-progress-inner"></div>
</div>
<div class="pace-activity"></div>
</div>
<header class="product-header">
<div class="pull-left logo-container">
<!-- BEGIN LOGO-->
var React = require('react');
var Router = require('react-router');
var Link = Router.Link;
var ReactPropTypes = React.PropTypes;
var ProductStore = require('../../stores/ProductStore.react.jsx')
var ErrorNotice = require('../../components/common/ErrorNotice.react.jsx');
var ProductActionCreators = require('../../actions/ProductActionCreators.react.jsx');
var AuthenticatedMixin = require('../../components/common/AuthenticatedMixin.react.jsx');
var ReactInfinity = require('react-infinity');
@daimagine
daimagine / campur.js
Last active September 28, 2016 14:24 — forked from fadliawan/campur.js
Asura + Wyvern
// Asura (CustomerController.js)
static async postCustomerWithMagic(ctx, next) {
// .. something something
} else if (primary_id_type === 'customerId') {
let { isActive, isProvisioned } = await api.classify(primary_id, primary_id_type);
if (!isActive && !isProvisioned) {
await api.provision(customer.id, 'spAccountId', customer.sku, effectiveDate, primary_id);
}
} else {
@daimagine
daimagine / gist:c7938f81989e41ecfbadcdd6f113a0dc
Created November 9, 2016 21:26 — forked from tamoyal/gist:10441108
Create super user and database user in Mongo 2.6
# Create your superuser
$ mongo
> use admin
> db.createUser({user:"someadmin",pwd:"secret", roles:[{role:"root",db:"admin"}]})
> exit
# Alias for convenience (optional and at your own risk)
$ echo 'alias mongo="mongo --port 27017 -u someadmin -p secret --authenticationDatabase admin"' >> ~/.bash_profile
$ source ~/.bash_profile
@daimagine
daimagine / iterm2-solarized.md
Created January 11, 2017 03:31 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@daimagine
daimagine / iterm2.md
Created January 11, 2017 06:44
iterm2 cheatsheet

Tabs and Windows

Function Shortcut
Previous Tab + Left Arrow
Next Tab + Right Arrow
Go to Tab + Number
Go to Window + Option + Number
Go to Split Pane by Direction + Option + Arrow
Go to Split Pane by Order of Use + ] , + [
@daimagine
daimagine / nginx.conf
Created March 21, 2018 01:10 — forked from Stanback/nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
@daimagine
daimagine / git-aliases.md
Created May 15, 2018 01:35 — forked from EQuimper/git-aliases.md
The Ultimate Git Alias Setup

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc