Skip to content

Instantly share code, notes, and snippets.

@wgx
wgx / example_blog.md
Created February 10, 2017 16:21
An example post in markdown with Jekyll front matter
layout title date header-img type
post
QueryTree: code-free data exploration and visualization
2017-02-07 04:09:33 -0800
/img/ipad-bed-querytree.jpg
post

The best tools become the best by listening to the people who use them.

Over the last few months, we’ve been updating and tweaking QueryTree – a code-free data visualization and reporting tool that plugs into your database.

@wgx
wgx / s3_website.yml
Created February 10, 2017 16:25
Sample s3_website configuration file
s3_id: $S3_ID
s3_secret: $S3_SECRET
s3_bucket: %BUCKET_NAME%
s3_endpoint: eu-west-1
@wgx
wgx / bitbucket-pipelines.yml
Created February 10, 2017 16:27
A sample bitbucket pipelines deployment configuration with Jekyll and s3_website
image: ruby:2.1.7
pipelines:
default:
- step:
script:
- bundler --version
- bundle install
- bundle exec jekyll build
branches:
@wgx
wgx / Gemfile
Created February 10, 2017 16:27
A sample Gemfile to be run by Bitbucket Pipelines
source 'https://rubygems.org'
gem 'jekyll', '3.0.1'
gem 'jekyll-paginate', '1.1.0'
gem 's3_website', '2.12.2'
@wgx
wgx / hosts
Created September 16, 2017 07:42
My default /private/etc/hosts
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
#!/bin/bash
lsb=$(i2cget -y -f 0 0x34 0x5f)
msb=$(i2cget -y -f 0 0x34 0x5e)
bin=$(( $(($msb << 4)) | $(($lsb & 0x0F))))
cel=`echo $bin | awk '{printf("%.0f", ($1/10) - 144.7)}'`
fah=`echo $cel | awk '{printf("%.0f", ($1 * 1.8) + 32)}'`
echo "CHIP Temp: $cel°C $fah°F"

To convert a file, use to the SQLizerFile object, like this:

using SQLizerClient;

var file = new SQLizerFile("source.csv");

file.DatabaseType = DatabaseType.MySQL;
file.TableName = "my_table";
file.HasHeaders = true;
@wgx
wgx / sqlizer-dotnet-example.md
Created March 10, 2019 10:01
SQLizer .NET API Client example code

To convert a file, use to the SQLizerFile object, like this:

SQLizerClient.Settings.ApiKey = "{your api key}"; // This can be found on https://sqlizer.io/account/

var file = new SQLizerClient.SQLizerFile("source.xlsx");

file.DatabaseType = SQLizerClient.DatabaseType.MySQL;
file.TableName = "my_table";
file.HasHeaders = true;
@wgx
wgx / find_cams.sh
Created July 17, 2019 08:37
Nmap look for web servers / network cameras on current network
sudo nmap -Ap 80,8000,8080,443,8443,7443,7070,7000,22,23,21 192.168.1.0/24
@wgx
wgx / hide-blue-ticks.js
Created July 16, 2020 16:33
Paste into the console on Twitter to hide tweets from verified accounts
// source: https://news.ycombinator.com/item?id=23860213
for (const node of document.querySelectorAll('[aria-label="Verified account"]')) {
node.closest('[role="article"]').remove()
}