Skip to content

Instantly share code, notes, and snippets.

View yashhere's full-sized avatar

Yash Agarwal yashhere

View GitHub Profile
@lrei
lrei / gist:1510028
Created December 22, 2011 11:50
Fetch RSS Feeds Using Multiple Processes
#!/usr/bin/env python
import Queue
import multiprocessing
import urllib2
import feedparser
import socket
feeds = ['http://today.reuters.com/rss/topNews',
'http://today.reuters.com/rss/domesticNews',
@xuhdev
xuhdev / ctags_with_dep.sh
Last active June 13, 2024 15:47
Generate ctags file for C or C++ files and its depedencies (included header files). This could avoid you to always generate a huge tags file.
#!/bin/sh
# https://www.topbug.net/blog/2012/03/17/generate-ctags-files-for-c-slash-c-plus-plus-source-files-and-all-of-their-included-header-files/
# ./ctags_with_dep.sh file1.c file2.c ... to generate a tags file for these files.
gcc -M "$@" | sed -e 's/[\\ ]/\n/g' | \
sed -e '/^$/d' -e '/\.o:[ \t]*$/d' | \
ctags -L - --c++-kinds=+p --fields=+iaS --extra=+q
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@andsens
andsens / bootstrap_homeshick.sh
Last active December 27, 2023 12:47
Script that can set up an entire user account with homeshick automatically
#!/bin/bash -ex
# Paste this into ssh
# curl -sL https://gist.github.com/andsens/2913223/raw/bootstrap_homeshick.sh | tar -xzO | /bin/bash -ex
# When forking, you can get the URL from the raw (<>) button.
### Set some command variables depending on whether we are root or not ###
# This assumes you use a debian derivate, replace with yum, pacman etc.
aptget='sudo apt-get'
chsh='sudo chsh'
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@amaxwell01
amaxwell01 / interviewitems.MD
Created September 15, 2012 14:17
My answers to over 100 Google interview questions

##Google Interview Questions: Product Marketing Manager

  • Why do you want to join Google? -- Because I want to create tools for others to learn, for free. I didn't have a lot of money when growing up so I didn't get access to the same books, computers and resources that others had which caused money, I want to help ensure that others can learn on the same playing field regardless of their families wealth status or location.
  • What do you know about Google’s product and technology? -- A lot actually, I am a beta tester for numerous products, I use most of the Google tools such as: Search, Gmaill, Drive, Reader, Calendar, G+, YouTube, Web Master Tools, Keyword tools, Analytics etc.
  • If you are Product Manager for Google’s Adwords, how do you plan to market this?
  • What would you say during an AdWords or AdSense product seminar?
  • Who are Google’s competitors, and how does Google compete with them? -- Google competes on numerous fields: --- Search: Baidu, Bing, Duck Duck Go
@bsdcpp
bsdcpp / cvi.sh
Last active August 27, 2021 06:55
simple script to create ctags & cscope files for reading code with vim.
#############################
#usage: 1. cvi.sh . -------> seaching files in current directory Recursively
# 2. cvi.sh sys -------> searching files in /usr/include
#
#I hope you can provide some suggestions, thank you.
#############################
#!/bin/bash
#####
#find . -regex ".*\.\(c\|h\|hpp\|cc\|cpp\)" -print
#####
@X4
X4 / krawall.sh
Last active January 7, 2018 09:55
Krawall is a "Wallpaper Changer" for all common desktop environments (xfce4, i3/xmonad, enlightenment (e17), gnome2, gnome3, kde3 and kde4)
#!/bin/bash
# -------------------------------------------------------
# @author X4
# @version 1.0
#
# HowTo:
# You can add a new GlobalHotkey to the media forward an back buttons for example.
# There are other ways to run this script: Button or Keypresses, Plasmoids, Events..
#
# Use these parameters when on XFCE for example:
@ekanna
ekanna / map2json.go
Created July 17, 2013 17:02
Generating arbitrary JSON data using map in golang
// Generating arbitrary JSON data using map
package main
import "fmt"
import "encoding/json"
func main() {
keys := []string{"Segment", "Jan", "Feb", "Apr"}
values := []interface{}{"ME",1000,2000,3000}
@unbracketed
unbracketed / gist:6027277
Last active February 25, 2022 09:28
Using Tmux Sessions for Managing Multiple Project / Computing Workspaces

Some fellow Tmux users I spoke with weren't using the Sessions feature, which I think is one of the coolest features of Tmux. No faulting the Tmux developers for very complete documentation, but it can take a few read-throughs for some of us before the core architecture becomes clear:

  1. The Tmux Server is a collection of Sessions.
  2. A Session is a collection of Windows.
  3. A Window is a collection of Panes which visually subdivide it in the terminal.
  4. Windows and Panes can be moved and shared between Windows, including Windows in other Sessions.

Having used a modern web browser, you already understand principles 1-3. You can open multiple browser windows (Tmux Session), each browser window has multiple tabs (Tmux Window), and each tab has a web page which probably contains multiple visual sections (Tmux Pane).