Skip to content

Instantly share code, notes, and snippets.

View przbadu's full-sized avatar
🏠
Working from home

Pushpa Raj Badu przbadu

🏠
Working from home
View GitHub Profile

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@przbadu
przbadu / vimux.md
Last active August 29, 2015 14:19 — forked from fredv/vimux.md
@przbadu
przbadu / bulk-file-rename.rb
Last active January 22, 2017 03:32
Bulk rename files inside given directory path. Basically remove certain strings/text from the file name that we don't want in those file name and are common in all the files.
# Your directory path where all files are there which you want to rename
# without trailing / (slash)
dir_path = "your/dir/path/goes/here"
Dir.glob("#{dir_path}/*").each do |file|
# squeeze all whitespaces into single whitespaces
new_file_name = file.squeeze(' ')
base_name = File.basename(new_file_name)
if base_name.include?('Xamarin.Android Tutorial - ')
@przbadu
przbadu / GIF-Screencast-OSX.md
Created January 23, 2017 10:58 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

import React from "react";
import { render } from "react-dom";
const ParentComponent = React.createClass({
getDefaultProps: function() {
console.log("ParentComponent - getDefaultProps");
},
getInitialState: function() {
console.log("ParentComponent - getInitialState");
return { text: "" };
@przbadu
przbadu / linking dotfiles.md
Last active March 18, 2017 11:44
how to link vim dotfiles

Installation

cd ~
git clone git@github.com:[username]/dotfiles.git
@przbadu
przbadu / form-validation.html
Created May 21, 2017 09:35
Form validation to check, name should present, email should contain @ and . character and password should be atleast 8 character long
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Form validation</title>
<script>
function validate() {
var name = document.getElementById('name').value;
var password = document.getElementById('password').value;
var email = document.getElementById('email').value;
@przbadu
przbadu / Brewfile
Last active June 1, 2017 04:53
Manage brew packages in Brewfile
tap 'caskroom/cask'
tap 'caskroom/fonts'
brew 'ack'
brew 'ctags'
brew 'git'
brew 'gdrive'
brew 'qt@5.5'
brew 'imagemagick'
brew 'vim'
@przbadu
przbadu / Sublime Setup.md
Last active June 21, 2017 08:14
Setup sublime for devlopment

keymap

[
	{ "keys": ["f6"], "command": "expand_fqcn" },
	{ "keys": ["shift+f6"], "command": "expand_fqcn", "args": {"leading_separator": true} },
	{ "keys": ["f5"], "command": "find_use" },
	{ "keys": ["f4"], "command": "import_namespace" },
	{ "keys": ["alt+ctrl+i"], "command": "reindent", "args": {"single_line": false}},
	{ "keys": ["shift+f12"], "command": "goto_definition_scope" },
# This is example contains the bare mininum to get nginx going with
# unicorn servers. Generally these configuration settings
# are applicable to other HTTP application servers (and not just Ruby
# ones), so if you have one working well for proxying another app
# server, feel free to continue using it.
#
# The only setting we feel strongly about is the fail_timeout=0
# directive in the "upstream" block. max_fails=0 also has the same
# effect as fail_timeout=0 for current versions of nginx and may be
# used in its place.