Skip to content

Instantly share code, notes, and snippets.

View amitchhajer's full-sized avatar

Amit Chhajer amitchhajer

View GitHub Profile
@amitchhajer
amitchhajer / add_row.sh
Created March 31, 2017 06:18 — forked from kristjan/add_row.sh
Google Spreadsheet row insertion example
# $auth from auth.sh
# $spreadsheet_id from get_spreadsheets.sh
# $worksheet_id from get_worksheets.sh
curl \
--header "Authorization: GoogleLogin auth=$auth" \
--header 'Content-Type: application/atom+xml' \
-d @data.xml \
-X POST \
"https://spreadsheets.google.com/feeds/list/$spreadsheet_id/$worksheet_id/private/full"
# Example data in data.xml
apt-get install -y ppa-purge
add-apt-repository -y ppa:ondrej/php5-oldstable
apt-get update
ppa-purge ppa:ondrej/php5
apt-get update && apt-get upgrade -y && apt-get autoremove -y && apt-get autoclean -y
import sublime
import sublime_plugin
class NumberCommand(sublime_plugin.TextCommand):
def run(self, edit):
selection = self.view.sel()
for region in selection:
try:
value = int(self.view.substr(region))
self.view.replace(edit, region, str(self.op(value)))
@amitchhajer
amitchhajer / ntpdate
Created December 28, 2012 06:15 — forked from anonymous/ntpdate
There are times when you need to keep the date and time of your system to be correct.
Ntpdate in linux helps you do the same
sudo ntpdate -u ntp.ubuntu.org
ntpdate are installed on most distributions, if not install using apt-get.