Skip to content

Instantly share code, notes, and snippets.

View ch4's full-sized avatar
💯

Harvey ch4

💯
View GitHub Profile
@ch4
ch4 / how-to-publish-to-npm.md
Created November 15, 2020 04:20 — forked from coolaj86/how-to-publish-to-npm.md
How to publish packages to NPM

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "[email protected]"
npm set init.author.url "http://yourblog.com"

npm adduser
@ch4
ch4 / curl_pia.php
Created November 25, 2017 06:49 — forked from alexkharlamov/curl_pia.php
Scrape a website using Private Internet Access
$curl = curl_init();
$url = 'http://www.url_you_want_to_scrape.com';
$username = 'username'; // substitute your PIA PPTP/L2TP/SOCKS username (different from regular PIA username)
$password = 'password'; // substitute your PIA PPTP/L2TP/SOCKS password (different from regular PIA password)
$pia_url = 'proxy-nl.privateinternetaccess.com:1080'; // current one should be here: https://helpdesk.privateinternetaccess.com/hc/en-us/articles/236265587-Can-I-Use-SOCKS5-
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => $url,
CURLOPT_PROXYTYPE => CURLPROXY_SOCKS5,
CURLOPT_PROXY => 'socks5://' . $username . ':' . $password . '@' . $pia_url,
@ch4
ch4 / gist:e4dce7313c9a42df665155c23bed255b
Created June 23, 2017 05:34
sed regex capture group example
echo "/junk1/harvey/junk2/test.jpg" | sed "s/^.*\/junk1\/\(\S*\)\/junk2.*$/\1/"
# prints "harvey"
@ch4
ch4 / linkedin auto-inviter
Last active August 20, 2016 22:38 — forked from maksii/linkedin auto-inviter
Script to automatically add connections from "People You May Know" page
var inviter = {} || inviter;
inviter.userList = [];
//inviter.className = 'bt-request-buffed buffed-blue-bkg-1';
inviter.className = 'bt-request-buffed';
inviter.refresh = function () {
window.scrollTo(0, document.body.scrollHeight);
window.scrollTo(document.body.scrollHeight, 0);
window.scrollTo(0, document.body.scrollHeight);
window.scrollTo(document.body.scrollHeight, 0);
https://launchpad.net/~indicator-multiload/+archive/ubuntu/stable-daily
laptop-mode-tools
@ch4
ch4 / gist:67f0f0477bb0be8958dc
Created May 27, 2015 01:47
close all angular modal programmatically
From: https://github.com/angular-ui/bootstrap/issues/1173
$('.modal-content > .ng-scope').each(function()
{
try
{
$(this).scope().$dismiss();
}
catch(_) {}
});
@ch4
ch4 / gist:2a349f92bfb5ae669f43
Last active August 29, 2015 14:21
cool audio/video libraries
http://www.paulnasca.com/open-source-projects#TOC-Paul-s-Extreme-Sound-Stretch
http://www.paulnasca.com/algorithms-created-by-me#TOC-PaulStretch-extreme-sound-stretching-algorithm
https://trac.ffmpeg.org/wiki/Create%20a%20video%20slideshow%20from%20images
http://java-hackers.com/p/subblue/node-fluent-ffmpeg
http://stackoverflow.com/questions/24309825/ffmpeg-with-node-js-transcode-a-file-to-another-format
https://github.com/fluent-ffmpeg/node-fluent-ffmpeg
https://github.com/damianociarla/node-ffmpeg
http://www.tedsimbajon.com/Blog/TechBlogExploded.php?id=85
http://ksloan.net/watermarking-videos-from-the-command-line-using-ffmpeg-filters/
http://highscalability.com/blog/2015/1/12/the-stunning-scale-of-aws-and-what-it-means-for-the-future-o.html
http://www.codeproject.com/Articles/762203/Csharp-LINQ-and-IEqualityComparer
http://coolors.co/
http://omegacoder.com/?p=792
http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api
http://0x74696d.com/posts/falling-in-and-out-of-love-with-dynamodb-part-ii/
http://mobile.awsblog.com/post/TxBVEDL5Z8JKAC/Use-Amazon-Cognito-in-your-website-for-simple-AWS-authentication
http://www.spencerfry.com/whats-a-non-programmer-to-do
@ch4
ch4 / gist:7334c21752286c398275
Last active August 29, 2015 14:07
keybase.md
### Keybase proof
I hereby claim:
* I am ch4 on github.
* I am ch4 (https://keybase.io/ch4) on keybase.
* I have a public key whose fingerprint is F309 06F6 570B 6634 6C15 4702 EF5E 98B8 3663 C39B
To claim this, I am signing this object:
@ch4
ch4 / gist:24925d48d041521e7dd8
Created June 17, 2014 09:54
ubumtu softraid 0 with 5 drives
mdadm --create --verbose /dev/md0 --level=stripe --raid-devices=5 /dev/sdb /dev/sdc /dev/sdd /dev/sde /dev/sdf
mkfs.ext4 /dev/md0
mdadm --detail --scan >> /etc/mdadm/mdadm.conf
update-initramfs -u