Skip to content

Instantly share code, notes, and snippets.

View jamiew's full-sized avatar

Jamie Dubs jamiew

View GitHub Profile
#!/usr/bin/env ruby
# quick Google PageRank lookup
# usage: ~/bin/pagerank jamiedubs.com
# => 6
#
# by Vsevolod S. Balashov <vsevolod @ balashovREMOVETHIS.name>
# hacks/binify by Jamie Dubs <http://jamiedubs.com>
# based on 3rd party code snippets (see comments)
# TODO: make into a gem... the existing googlePR one is broken!
@jamiew
jamiew / snapshot.rb
Created April 29, 2022 15:26 — forked from dougpfeffer/snapshot.rb
NFT Collection Snapshot Generate with Moralis
# Requires a Moralis API key.
# Writes out lists of owners of each token of each contract listed in the `CONTRACTS` array.
# Doesn't work on OpenSea contracts.
require 'net/http'
require 'uri'
require 'json'
MORALIS_API_KEY = ''
#!/bin/bash
# @jamiew 2020-01-27
#
# Generate a Wu-Tang name using the "official" name generator
# https://www.mess.be/inickgenwuname.php
# (AKA the Childish Gambino Wu-Tang Name Generator)
# TODO output a more username-friendly format - no spaces or special chars
#
# This script depends on `curl`, `td` and `pup`
# Some clever regex could eliminate the need for pup
@jamiew
jamiew / pimp_prompt.sh
Created January 21, 2011 17:55
put this in your .bashrc/.bash_profile... works with both git and svn
parse_git_branch() {
ref=$(git symbolic-ref -q HEAD 2> /dev/null) || return
printf "${1:-(%s)}" "${ref#refs/heads/}"
}
parse_svn_revision() {
local DIRTY REV=$(svn info 2>/dev/null | grep Revision | sed -e 's/Revision: //')
[ "$REV" ] || return
[ "$(svn st)" ] && DIRTY=' *'
echo "(r$REV$DIRTY)"
@jamiew
jamiew / eventmachine url expansion tests.rb
Created May 13, 2011 05:53
Noodling with different ways of expanding short URLs in bulk
require 'rubygems'
require 'benchmark'
require 'pp'
require 'mechanize'
require 'eventmachine'
require 'em-http-request'
def syncronous(urls)
agent = Mechanize.new
expanded_urls = urls.map{|url|
@jamiew
jamiew / tumblr-photo-ripper.rb
Created July 13, 2011 17:46
Download all the images from a Tumblr blog
# Usage:
# [sudo] gem install mechanize
# ruby tumblr-photo-ripper.rb
require 'rubygems'
require 'mechanize'
# Your Tumblr subdomain, e.g. "jamiew" for "jamiew.tumblr.com"
site = "doctorwho"
[Unit]
Description=IPFS daemon
After=network.target
[Service]
### Uncomment the following line for custom ipfs datastore location
# Environment=IPFS_PATH=/path/to/your/ipfs/datastore
ExecStart=/snap/bin/ipfs daemon --enable-pubsub-experiment --enable-namesys-pubsub --enable-gc --migrate
Restart=on-failure
@jamiew
jamiew / vhx-megaplaya.html
Created September 14, 2011 03:18
Example of embedding VHX megaplaya and playing Vimeo videos
<!DOCTYPE html>
<html>
<head>
<title>Videos</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js"></script>
<script type="text/javascript" src="http://vhx.tv/javascripts/jquery.swfobject-1.1.1.js"></script>
<style type="text/css" media="screen">
html, body { height: 100%; width: 100%; margin: 0; padding: 0; }
@jamiew
jamiew / helium-etl-update.sh
Created August 13, 2020 21:29
Simple script to manually update and restat a Helium blockchain-etl node
#!/bin/sh
set -e
git pull origin master
make release
make migrations
make start
tail -F _build/dev/rel/blockchain_etl/log/console.log