Skip to content

Instantly share code, notes, and snippets.

View stephenlb's full-sized avatar
😀
Coding with Rust

Stephen Blum stephenlb

😀
Coding with Rust
View GitHub Profile
@stephenlb
stephenlb / always-readme.md
Last active April 14, 2023 13:38
Solidity Smart Contract all-in-one that allows the crowd-sale of custom tokens for as long as the owner wallet balance is above zero. See readme for more details.

Simplified Modifiable ERC20 Token Details

Controllable Crowd-sale and transferable ownership allows you to change ownership and change exchange rates.

  • Owner Wallet receives ETH funds.
  • Owner Wallet holds TOKEN's for sale.
  • Moving tokens from owner wallet to another removes publicly purchaseable token inventory.
  • Custom Exchange Rate ETH for YOUR TOKEN. Default is 1:10 One ETH = 10 YOUR TOKEN.
  • Changable Exchange Rate at any time!
@keyosk
keyosk / README.md
Last active January 11, 2023 00:49
GDQ Schedule Page Current Run Reloader

Games Done Quick Schedule Enhancements

This script1 will allow you to click the name of a game and it will open the corresponding Speed Run Listings for the game

Footnotes

  1. Using the tampermonkey browser extension you can add a custom user script which runs on the Games Done Quick schedule page.

@stephenlb
stephenlb / subscribe.sh
Last active July 8, 2021 18:19
Bash and Shell Command PubNub Subscribe in One Line - Basic TCP Subscribe Calls
## =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
## URL Variables
## http://p.pubnub.com/stream/<SUBKEY>/<CHANNEL>/0/-1
## =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
## Demo Stream
while true; do (printf 'GET http://p.pubnub.com/stream/sub-c-5f1b7c8e-fbee-11e3-aa40-02ee2ddab7fe/pubnub-sensor-network/0/-1 HTTP/1.1\r\nHost: pubnub\r\n\r\n'; sleep 5) | nc p.pubnub.com 80; done
## Local tunnel
curl "http://0.0.0.0:80/publish/demo-36/demo-36/0/ch6/0/1"
@erichiggins
erichiggins / datastore_fetch_all.py
Last active November 25, 2020 17:31
Efficiently page over a Query to fetch all entities from the Google App Engine Datastore.
#!/usr/bin/python
"""
Functions are provided for both the DB and NDB Datastore APIs.
References:
* https://cloud.google.com/appengine/docs/python/datastore/queries
* https://cloud.google.com/appengine/docs/python/ndb/queries
"""
def db_fetch_all(query, limit=100, cursor=None):
@stephenlb
stephenlb / animated-gif.md
Last active October 31, 2020 22:57
DIY How to make your own HD Animated GIF Generator

HD Animated GIF Generator

You can make your own HD animated GIF generator.
Follow along with these commands to get started.

HD Animated GIF Generator

git clone git://source.ffmpeg.org/ffmpeg.git
cd ffmpeg
@stephenlb
stephenlb / pam-example.py
Last active May 25, 2020 02:43
NEW UPDATE: https://github.com/pubnub/python/tree/master/python <-- PubNub Access Manager (PAM) Python Full Library for Granting and Revoking Access in Real-Time on the PubNub Real-Time Network.
import pam
## PubNub Access Manager (PAM)
manager = pam.access(
pubkey="pam",
subkey="pam",
seckey="pam"
)
## Grant User Access
@parasyte
parasyte / fixes.md
Created June 4, 2019 18:37
Nginx bug fixes 1.11.2 ~ 1.6.0

1.11.3 (26 Jul 2016)

*) Bugfix: socket leak when using HTTP/2.

1.11.5 (11 Oct 2016)

*) Bugfix: in the $realip_remote_addr variable.

@ajb413
ajb413 / index.js
Created May 1, 2018 00:32
audio lext test
var AWS = require('aws-sdk');
AWS.config.update({
accessKeyId: "__id__",
secretAccessKey: "__secret__",
});
var lexruntime = new AWS.LexRuntime({region: 'us-east-1'});
@stephenlb
stephenlb / blocks-message-copy.js
Last active February 7, 2017 23:27
PubNub Message Copy - https://admin.pubnub.com/#/blocks/1165/import - Copy a Message between PubNub Keys 🎉
export default (request) => {
const xhr = require('xhr')
const pub_key = 'demo' // YOUR 2nd PUBLISH KEY
const sub_key = 'demo' // YOUR 2nd SUBSCRIBE KEY
const chncopy = request.channels[0]
const msgcopy = JSON.stringify(request.message)
const url = "http://pubsub.pubnub.com/publish/" + [
pub_key, sub_key, 0, chncopy, 0, msgcopy
].join('/')
@stephenlb
stephenlb / history.md
Last active October 3, 2016 20:29
PubNub History API V2

PubNub History API V2

/v2/history/sub-key/<sub-key>/channel/<channel>?URL_PARAMETERS
URL Parameters:
start (time token): Beginning of a timeline slice (exclusive)