Skip to content

Instantly share code, notes, and snippets.

View ckunte's full-sized avatar

Chetan Kunte ckunte

View GitHub Profile
@ckunte
ckunte / inst-ruby193.sh
Created June 14, 2013 01:51
This lets me install ruby 1.9.3, needed to run gollum on my ubuntu 10.04.4 LTS localhost.
#!/usr/bin/env sh
echo "Installing ruby 1.9.3 on ubuntu.."
sudo apt-get update
sudo apt-get install curl
\curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
rvm requirements
rvm install 1.9.3
rvm use 1.9.3 --default
@ckunte
ckunte / eurl.py
Last active May 4, 2023 23:50
A reading list.
#!/usr/bin/env python
# encoding: utf-8
"""
eurl.py extracts all URLs (one per line) from the OPML file or URL. [I needed
this script produce a list of feed URLs so I could manually enter these RSS
feeds in the new Reeder 2 for iOS.]
Acknowledgement: Special thanks to Kurt McKee ( http://kurtmckee.org/ ) for the
script: http://stackoverflow.com/a/7782782
"""
@ckunte
ckunte / disable-shadowed-screenshots.txt
Last active October 14, 2016 12:15
Disable shadow from Apple OS X screen capture
defaults write com.apple.screencapture disable-shadow -bool true
killall SystemUIServer
@ckunte
ckunte / ph.py
Last active January 4, 2016 11:39
This script allows me to purge my git history. (Run from within the root of repo's folder.)
#!/usr/bin/env python
# encoding: utf-8
"""
ph.py -- purge (git) history
2015 ckunte
"""
import os
def main():
@ckunte
ckunte / md2txt.sh
Last active December 6, 2019 02:02
Convert all Markdown files in a folder to plain text version. (It strips all html and markdown markups in text.)
#!/usr/bin/env zsh
# 2014 ckunte
# Convert Markdown files in a folder to plain text
# Requires pandoc and zsh.
#
# Run the following at zsh prompt:
#
# $ zsh md2txt.sh
#
for file in *.md; do pandoc -f markdown -t plain --wrap=none "$file" -o "$file.txt"; done
#!/usr/bin/env python
# encoding: utf-8
"""
mapsite.py
2014-06-07: Created by ckunte.
2014-08-28: Updated to urllib3, and beautifulsoup4.
Requirements:
1. beautifulsoup4 module. (pip install beautifulsoup4)
2. A file named srvclst.txt with ping servers list.
@ckunte
ckunte / r1.scss
Created December 14, 2014 10:17
Template + SASS file.
/*
(c) 2011 ckunte.
*/
// Widths for screens other than handhelds
$cwidth: 700px;
$pwidth: 640px;
// Side Margins
$smrg: ($cwidth - $pwidth) / 2;
@ckunte
ckunte / code-transform.php
Last active September 29, 2017 09:11
Code transform (WordPress plugin)
<?php
/*
Plugin Name: Code transform
Plugin URI:
Description: Based on <a href="http://1976design.com/blog/archive/2004/07/29/redesign-tag-transform/">Dunstan Orchard's tag transformations</a>, this plugin now can pull and list code snippets from flat .txt files. The plugin code is based on <a href="http://mathiasbynens.be/archive/2005/06/tag-transformations">Mathias Bynens</a>. Syntax in the post: <code>&lt;codeins="filename" /&gt;</code>. Filename to be without the extension, e.g. if the filename is <code>test.txt</code>, then the code becomes <code>&lt;codeins="test" /&gt;</code>.
Version: 1.0
Author: ckunte
Author URI: http://ckunte.net/
*/
@ckunte
ckunte / dateline.php
Created April 2, 2015 00:44
Dateline linked to archive by day, month and year (for WordPress)
//
// WordPress has a built-in support for archive by day, archive by month,
// and archive by year, and so, this following snippet converts the dateline
// below each post linkable by day, month, and year to the archive.
// 2008 ckunte
//
<?php
$arc_day = get_the_time('j');
$arc_month = get_the_time('m');
$arc_year = get_the_time('Y');
@ckunte
ckunte / doodles.php
Created April 2, 2015 00:49
Doodles, ala Google, for a php powered site (works for WordPress too).
<?php
//
// Autogenerate doodles (ala Google) for specific dates.
// Following is an example. Repeat from line 10 to line 18
// in the code below for other events, and update event
// details, and image for the event.
// 2008 ckunte
//
$today = getdate();
/* Christmas -- Example of a picture message */