Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View parolkar's full-sized avatar

Abhishek Parolkar parolkar

View GitHub Profile
@parolkar
parolkar / mailmerge.scpt
Created October 18, 2023 08:41 — forked from johnwickerson/mailmerge.scpt
Mail-merge from a CSV file using Apple Mail
-- Mail-merge script
-- Assembled by John Wickerson (using various parts pasted from the internet, credited individually below) in April 2021.
-- Instructions:
---- 1. Select a message in Mail (probably one that has been saved as a Draft) and then run this script.
---- 2. The script will ask you for a CSV file containing the data to be mail-merged. The first column of this CSV file must be named "email".
---- 3. The script will substitute $FOO in the contents of the message with the contents of column FOO in the CSV file.
---- 4. Any to/cc/bcc recipients in the original message will be preserved.
---- 5. Unfortunately, any attachments in the original message are not preserved, but if you want an attachment, you can add it
---- using this script by uncommenting one of the lines below.
@parolkar
parolkar / gist:7119e578a00faf16c337408496e5469a
Created October 16, 2018 10:09
Apache Beam & Talend Data Streams
Future-proofing your code : https://www.oreilly.com/ideas/future-proof-and-scale-proof-your-code
Basic Introduction / Step by step : https://www.talend.com/blog/2018/04/23/how-to-develop-a-data-processing-job-using-apache-beam/
Credits:
https://docs.google.com/presentation/d/17eq17-4KYvF1-2sCOo0sSUdm6gj4h6sWLhLDUYOe1cU/edit#slide=id.g11fb502606_9_111
@parolkar
parolkar / DNS Resolution & Traceroute from Singapore
Last active April 24, 2017 13:27
Repo Latency affecting installation performance
$dig repo.zoomdata.com
; <<>> DiG 9.8.3-P1 <<>> repo.zoomdata.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 6976
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;repo.zoomdata.com. IN A
@parolkar
parolkar / router.php
Last active August 29, 2015 14:08 — forked from tamagokun/router.php
<?php
$root = $_SERVER['DOCUMENT_ROOT'];
chdir($root);
$path = '/'.ltrim(parse_url($_SERVER['REQUEST_URI'])['path'],'/');
set_include_path(get_include_path().':'.__DIR__);
if(file_exists($root.$path))
{
if(is_dir($root.$path) && substr($path,strlen($path) - 1, 1) !== '/')
$path = rtrim($path,'/').'/index.php';
@parolkar
parolkar / gist:1882364
Created February 22, 2012 06:31
copy from s3 to HDFS without distcp
s3cmd get s3://bucket - | hadoop fs -copyFromLocal - /hdfs_location
@parolkar
parolkar / Procfile
Created January 30, 2012 07:45
Handy script to help analyse heroku dyno behaviour [CEDAR STACK]
web: ruby dyno_process_analyse.rb -p $PORT
worker: ruby dyno_process_analyse.rb -p $PORT
@parolkar
parolkar / quick_dialog_osascript
Created October 31, 2011 06:34
Cute little script to help in making interactive script when STDIN is unavailable
#!/usr/bin/ruby
result = `/usr/bin/osascript <<EOT
tell application "Terminal"
activate
set Input to display dialog "Enter Text:" with title "Hello" with icon 0 default answer "" buttons {"OK"} default button 1
return text returned of Input as string
end tell
EOT
`
var d = document.createElement("SCRIPT");
d.src = "http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js";
document.body.appendChild(d);
alert("Ready to go to viki.com!");
$('a.photo')[0].setAttribute("href","http://www.youtube.com/watch?v=NVh4OjSKk4g&feature=topvideos_mfh")
$('a.photo')[0].click();
var d = document.createElement("SCRIPT");
d.src = "http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js";
document.body.appendChild(d);
$('a.photo')[0].setAttribute("href","http://www.viki.com/channels/3303-dr-g-y-las-mujeres/videos/35579/1")
$('a.photo')[0].click();
$ git checkout 76a62f50f5831fe8be17ef6fa4e3e3e6d4dc3cbd (working old commit)
$ script/console
Loading development environment (Rails 2.3.2)
>> service_ads = ServiceAd.paginate :page => 1, :per_page => 6, :order=>'created_at DESC'
=> []
>> service_ads.class
=> WillPaginate::Collection
$ git checkout bae6edc759de3faf147f9f21a1e1ae6168c0ae49 (buggy current commit)