Skip to content

Instantly share code, notes, and snippets.

View gh0st's full-sized avatar

Chad Hollman gh0st

  • Oregon, United States
View GitHub Profile
@ErikAugust
ErikAugust / spectre.c
Last active April 15, 2024 13:55
Spectre example code
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif
@olliefr
olliefr / gdmpydemo.py
Created April 4, 2017 00:11
Google Distance Matrix API Python client example
# Google Distance Matrix Python Demo
# ==================================
#
# How to set up (Local part)
# --------------------------
#
# Must have Python (>= 3.4) installed with 'requests' library. On Windows, maybe try
# Anaconda Python? It has a 'conda' package manager, make sure 'requests' is installed.
#
# How to set up (Internet part)
@zenorocha
zenorocha / etc-hosts-on-win.md
Last active April 11, 2024 23:07
/etc/hosts on Windows

1. Get your IP Address

echo `ifconfig $(netstat -nr | grep -e default -e "^0\.0\.0\.0" | head -1 | awk '{print $NF}') | grep -e "inet " | sed -e 's/.*inet //' -e 's/ .*//' -e 's/.*\://'`

2. Modify your hosts file

notepad

- (NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewRowAction *moreAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"More" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){
// maybe show an action sheet with more options
[self.tableView setEditing:NO];
}];
moreAction.backgroundColor = [UIColor lightGrayColor];
UITableViewRowAction *blurAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"Blur" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){
[self.tableView setEditing:NO];
}];
@techtonik
techtonik / hashdeep.py
Created March 16, 2013 10:45
Python - hashdeep.py - recursive hash of directory tree files in hashdeep format
"""
Build recursive hash of files in directory tree in hashdeep format.
Hashdeep format description:
http://md5deep.sourceforge.net/start-hashdeep.html
hashdeep.py differences from original hashdeep:
- if called without arguments, automatically starts to build
@eugenehp
eugenehp / reverse-ip-lookup.js
Created July 8, 2012 14:58
node.js IP reverse lookup
var dns = require('dns');
function reverseLookup(ip) {
dns.reverse(ip,function(err,domains){
if(err!=null) callback(err);
domains.forEach(function(domain){
dns.lookup(domain,function(err, address, family){
console.log(domain,'[',address,']');
console.log('reverse:',ip==address);