Skip to content

Instantly share code, notes, and snippets.

View rahulvramesh's full-sized avatar
💻
#bud

Rahul V Ramesh rahulvramesh

💻
#bud
View GitHub Profile
@artlung
artlung / sitemap.xml.php
Created October 14, 2009 21:42
Generate XML sitemap from list of urls
<?php
/**
*
* This is a quick way to turn a simple text file
* with a list of urls in a text file (sitemap-urls.txt)
* into a valid XML Sitemap:
* http://en.wikipedia.org/wiki/Sitemaps
* Put this file sitemap.xml.php and sitemap-urls.txt at
* the webroot http://example.com/sitemap.xml.php
# How to echobot with XMPP, BOSH, and Strophe
1. Setup ejabberd(http://www.ejabberd.im/) server and setup account admin@localhost.local
NOTE: localhost should be enough. If you setup something else, make sure you add it at /etc/hosts like this
#/etc/hosts
127.0.0.1 localhost.local
NOTE: Also download Psi(http://psi-im.org/), and make sure you can connect to your ejabberd server.
2. Download strophe(http://code.stanziq.com/strophe/) and place it (eg: /Users/makoto/work/sample/strophejs-1.0)
@pksunkara
pksunkara / config
Last active April 28, 2024 18:59
Sample of git config file (Example .gitconfig) (Place them in $XDG_CONFIG_HOME/git)
[user]
name = Pavan Kumar Sunkara
email = pavan.sss1991@gmail.com
username = pksunkara
[init]
defaultBranch = master
[core]
editor = nvim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
pager = delta
@benolee
benolee / howto_pow_ubuntu.txt
Created July 1, 2011 03:32
HowTo Ubuntu pow-like setup
$ sudo aptitude install apache2 dnsmasq
$ sudo vim /etc/dnsmasq.conf
# ...
address=/dev/127.0.0.1
listen-address=127.0.0.1
$ sudo vim /etc/dhcp3/dhclient.conf
# uncomment line 20:
@coryalder
coryalder / blogpost.md
Created August 17, 2011 07:37
Extract html book files from the safari books online iPad app "Safari To Go" using php.

Save books out of Safari Books Online

From http://objectivesea.tumblr.com/post/9033067018/safaribooks

This is hard. I spent way too much time figuring this out, because I was annoyed that a book I bought (Addison-Wesley) was available online for free, except only for 45 days after which payment was required. So I made this hack... probably useful to no one else, but here it is.

Requirements:

  1. iPad.
  2. Safari To Go (the Safari Books Online iPad app).
Tables:
Users(:id, :username, etc.)
Questions(:id, :text)
Answers(:id, :question_id, :text)
UserAnswers(:id, :user_id, :question_id, :answer_id, :importance)
AcceptedAnswers(:id, :user_answer_id, :answer_id)
Relations
Questions <-> Answers: one-to-many
Questions <-> UserAnswers: one-to-many
@thomas11
thomas11 / gist:2909362
Created June 11, 2012 09:52
Log memory usage every n seconds in Go #golang
import (
"runtime"
"time"
)
...
go func() {
for {
var m runtime.MemStats
@erikreagan
erikreagan / mac-apps.md
Created August 4, 2012 19:18
Mac developer must-haves

Mac web developer apps

This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.

— Erik

@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active May 1, 2024 13:31
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@tobob
tobob / description
Last active September 29, 2017 08:51
My unicorn and nginx configuration
My unicorn and nginx configuration
use ln -s and place new_app in 'sites-enabled' folder
usefull commands:
lsof -wni tcp:8080 - get PID of all unicorn processes
kill -9 PID - kill process
nginx -s reload - reload nginx
unicorn_rails -c /home/workspace/new_app/config/unicorn.rb -D - starts unicorn server