Skip to content

Instantly share code, notes, and snippets.

@holydevil
holydevil / z-index.js
Created August 27, 2019 15:18
Script to list out z-index values of all parent nodes
//source: https://stackoverflow.com/a/46541425
var el = document.getElementById("#yourElement"); // or use $0 in chrome;
do {
var styles = window.getComputedStyle(el);
console.log(styles.zIndex, el);
} while(el.parentElement && (el = el.parentElement));
@holydevil
holydevil / cloudSettings
Created February 21, 2019 00:13
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-02-21T00:13:45.454Z","extensionVersion":"v3.2.4"}
@holydevil
holydevil / get-pnr-status.php
Created August 20, 2011 12:43
Get PNR status using Alagu's API
<?php
error_reporting(1);
//$url = "http://pnrapi.alagu.net/api/v1.0/pnr/6359817259?jsonp=parseJSON";
$url = "http://pnrapi.alagu.net/api/v1.0/pnr/6359817259";
$ch = curl_init($url);
//curl_setopt($ch, CURLOPT_HEADER, TRUE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
@holydevil
holydevil / yql-finance-quotes.php
Created August 20, 2011 14:55
YQL for Finance quotes
<h2>Using YQL to Finance quotes</h2>
<?php
$BASE_URL = "https://query.yahooapis.com/v1/public/yql";
// Form YQL query and build URI to YQL Web service
$yql_query = "select * from yahoo.finance.quotes where symbol in ('YHOO', 'APPL')";
$yql_query_url = $BASE_URL . "?q=" . urlencode($yql_query) . "&env=store://datatables.org/alltableswithkeys&format=json";
@holydevil
holydevil / gist:7312372
Created November 5, 2013 01:28
tcpdump to list HTTP requests source: http://stackoverflow.com/a/16610385
man tcpdump | less -Ip examples
# tcpdump filter for HTTP GET
sudo tcpdump -s 0 -A 'tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x47455420'
# tcpdump filter for HTTP POST
sudo tcpdump -s 0 -A 'tcp dst port 80 and (tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x504f5354)'
# monitor HTTP traffic including request and response headers and message body
# cf. https://sites.google.com/site/jimmyxu101/testing/use-tcpdump-to-monitor-http-traffic
$ git commit --amend --reset-author (Changes the most recent commit message + author in this case)
@holydevil
holydevil / gist:5390174
Created April 15, 2013 18:24
Curl request data log
curl --trace-ascii data.log --trace-time <url>
@holydevil
holydevil / chrome-settings
Created April 1, 2013 10:19
Chrome hacks
chrome://histograms/DNS
@holydevil
holydevil / ssh_tips
Created March 31, 2013 11:21
Fix for "Too many authentication failures for <username>" on hostgator
ssh -o PubkeyAuthentication=no user@hostname
@holydevil
holydevil / hack.sh
Created August 21, 2012 14:20 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#