Skip to content

Instantly share code, notes, and snippets.

@trevanhetzel
trevanhetzel / lazyload-video.html
Last active August 29, 2015 14:18
"Lazyload" videos
<video preload="none" autoplay loop poster="path/to/poster.jpg">
<source src="path/to/video.mp4" type="video/mp4">
<source src="path/to/video.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>

Sublime to Vim

  • Use Control+W instead of Alt+Backspace
  • To unindent a line, use Ctrl+D
  • To indent a line, use Ctrl+T
  • Upper-case J joins lines (same as Cmd+J in Sublime Text)
  • Use :edit! to force a reload of the current file from disk.
  • To skip to the first non-whitespace character on a line, press ^
  • yy copies (yanks) a line

Window Commands

@JCBarry
JCBarry / TKPHPPostScript.php
Created June 1, 2012 15:41
Tradeking API POST Example using different OAuth library on Google Code
<?php
require_once 'oauth.php';
$consumer_key = '';
$consumer_secret = '';
$access_token = '';
$access_secret = '';
$consumer = new OAuthConsumer($consumer_key,$consumer_secret);
$access = new OAuthToken($access_token,$access_secret);
@pdp7
pdp7 / install-tor.txt
Last active February 1, 2019 21:39
install tor non-exit relay on digital ocean
# My steps for creating a DigitalOcean server to run non-exit Tor node for just $5/mo
# Screen shots of my setup process: https://plus.google.com/photos/+DrewFustini/albums/6057260188204970945
# Create Digital Ocean account: https://www.digitalocean.com/
# Create Droplet on Digital Ocean: select $5/mo, and select Debian 7.0 64-bit
# This instructions are based on Tor Project: https://www.torproject.org/docs/tor-relay-debian.html.en
afustini@lappy486:~$ ssh root@107.170.203.104
root@107.170.203.104's password:
You are required to change your password immediately (root enforced)
Linux Tor300SoF 3.2.0-4-amd64 #1 SMP Debian 3.2.54-2 x86_64
@chengyin
chengyin / linkedout.js
Last active July 11, 2021 15:23
Unsubscribe all LinkedIn email in "one click". For an easier to use version, you can check out the bookmarklet: http://chengyin.github.io/linkedin-unsubscribed/
// 1. Go to page https://www.linkedin.com/settings/email-frequency
// 2. You may need to login
// 3. Open JS console
// ([How to?](http://webmasters.stackexchange.com/questions/8525/how-to-open-the-javascript-console-in-different-browsers))
// 4. Copy the following code in and execute
// 5. No more emails
//
// Bookmarklet version:
// http://chengyin.github.io/linkedin-unsubscribed/
@tilakpatidar
tilakpatidar / spark-rest-job.sh
Created July 11, 2019 05:28
Using spark master REST API to submit a job as a replacement to spark-submit command for python and scala.
#!/usr/bin/env bash
#python
curl -X POST http://localhost:6066/v1/submissions/create --header "Content-Type:application/json;charset=UTF-8" --data '{
"action":"CreateSubmissionRequest",
"appArgs":[
"/Users/tilak/jobs/test_job.py"
],
"appResource":"file:/Users/tilak/jobs/test_job.py",
"clientSparkVersion":"2.3.3",

⚠️ this is now stupidly out of date

Computers

  • 13" Macbook Pro 3.3 GHz i7 (late 2016)
  • Microsoft Surface Book (2016)

Peripherals

@graceavery
graceavery / harryPotterAliases
Last active May 10, 2023 02:51
bash aliases for Harry Potter enthusiasts
alias accio=wget
alias avadaKedavra='rm -f'
alias imperio=sudo
alias priorIncantato='echo `history |tail -n2 |head -n1` | sed "s/[0-9]* //"'
alias stupefy='sleep 5'
alias wingardiumLeviosa=mv
alias sonorus='set -v'
alias quietus='set +v'
@drkarl
drkarl / gist:739a864b3275e901d317
Last active October 17, 2023 10:43
Ask HN: Best Linux server backup system?

Linux Backup Solutions

I've been looking for the best Linux backup system, and also reading lots of HN comments.

Instead of putting pros and cons of every backup system I'll just list some deal-breakers which would disqualify them.

Also I would like that you, the HN community, would add more deal breakers for these or other backup systems if you know some more and at the same time, if you have data to disprove some of the deal-breakers listed here (benchmarks, info about something being true for older releases but is fixed on newer releases), please share it so that I can edit this list accordingly.

  • It has a lot of management overhead and that's a problem if you don't have time for a full time backup administrator.
@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API