Skip to content

Instantly share code, notes, and snippets.

@charud
charud / Menu.js
Last active December 30, 2016 19:39
import React from 'react';;
import { ContextMenu, MenuItem } from 'react-contextmenu';
import { MENU_ID } from './constants';
const Menu = (props) => {
return (
<ContextMenu id={MENU_ID}>
<MenuItem>Play {props.item.name}</MenuItem>
{props.item.isInCollection ?
<MenuItem>Remove</MenuItem> :
@charud
charud / .tmux.conf
Last active January 22, 2016 11:30
# mouse support
set-option -g mouse-select-pane on
set-option -g mouse-select-window on
set -g mouse-utf8 on
set -g mouse on
# ctrl+a instead of ctrl+b
set -g prefix C-a
unbind C-b
bind C-a send-prefix
@charud
charud / Fish Config
Last active November 20, 2016 21:28
# Autojump
[ -f /usr/local/share/autojump/autojump.fish ]; and . /usr/local/share/autojump/autojump.fish ]
# [ -f /usr/local/Cellar/autojump/22.2.4/share/autojump/autojump.fish ]; and . /usr/local/Cellar/autojump/22.2.4/share/autojump/autojump.fish ]
# Git Branch in terminal
set fish_git_dirty_color red
set fish_git_not_dirty_color green
function parse_git_branch
set shell=bash
" this combination gives absolute number for the current line
set relativenumber
set number
"set statusline=%f
set laststatus=2
set tabstop=4
@charud
charud / Lunarizer
Created August 13, 2012 14:06
Lunarize a string from shell
#!/bin/sh
#
# Lunarizer
# =========
#
# Installation
# ------------
# $ curl https://raw.github.com/gist/3341070/44869be7b0b7b7403465a78cde1ec3e3ce6e2788/Lunarizer > lunar; chmod +x lunar
# $ sudo cp lunar /usr/local/bin/lunar
#
@charud
charud / iptablesPort80To8080
Created August 4, 2012 22:32
Forward port 80 to port 8080 with iptables
sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
@charud
charud / tmpl-js.sublime-snippet
Created March 7, 2012 08:05
Template Tag for JQuery Templates
<snippet>
<content><![CDATA[
<script id="${1}" type="text/x-jquery-tmpl">
${2}
</script>
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>tmpl</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
@charud
charud / module-js-multi.sublime-snippet
Created March 7, 2012 08:03
Lightweight Javascript Module with support for many instances
<snippet>
<content><![CDATA[
var ${1:Namespace} = ${1:Namespace} || {};
${1:Namespace}.${2:Module} = function(options)
{
var me = {};
me.init = function()
{
@charud
charud / module-js-pub.sublime-snippet
Created March 7, 2012 08:02
Public method of Lightweight Javascript Module
<snippet>
<content><![CDATA[
me.${1} = function(${2})
{
${3}
};
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>pub</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
@charud
charud / module-js-priv.sublime-snippet
Created March 7, 2012 08:01
Private method of Lightweight Javascript Module
<snippet>
<content><![CDATA[
var ${1} = function(${2})
{
${3}
};
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>priv</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->