This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs') | |
const AWS = require('aws-sdk') | |
const { promisify } = require('util') | |
const s3 = new AWS.S3() | |
s3.uploadP = promisify(s3.upload) | |
const params = { | |
Bucket: 'fullstack-printshop', | |
Key: 'profile-photos/thedude.jpg', | |
Body: fs.createReadStream('thedude.jpg') | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This code is from: https://github.com/Wattenberger/Wattenberger-2019/blob/07024a820011988f5fbefed21161b1111f38e710/src/components/Blog/posts/Hooks/Hooks.jsx#L451-L470 | |
// It generates the SVG path for the curve between two lines on the post "Thinking in React Hooks", located here: https://wattenberger.com/blog/react-hooks | |
// | |
// It's a good idea to pull up the documentation on SVG paths here: https://www.w3.org/TR/SVG/paths.html | |
// | |
// As you may know, SVG paths are specified by a string where a | |
// letter is the "command" and the numbers following are the "arguments" | |
// | |
// We'll be using 4 commands: | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM: https://people.xiph.org/~greg/signdemo.txt | |
With Bitcoin 0.7 it's possible to keep your private keys | |
entirely offline without third party software. | |
In this example we have two hosts [offline] which is | |
totally offline and without a copy of the blockchain | |
and [online] which is a regular online node, both | |
running bitcoin 0.7. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# vim: set ft=ruby | |
# | |
# Nate Murray's ~/.irbrc | |
# | |
# Can be found at: | |
# http://gist.github.com/6626 | |
# git clone git://gist.github.com/6626.git gist-6626 | |
# | |
# Include colorization | |
require 'rubygems' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Raw transaction API example work-through | |
# Send coins to a 2-of-3 multisig, then spend them. | |
# | |
# For this example, I'm using these three keypairs (public/private) | |
# 0491bba2510912a5bd37da1fb5b1673010e43d2c6d812c514e91bfa9f2eb129e1c183329db55bd868e209aac2fbc02cb33d98fe74bf23f0c235d6126b1d8334f86 / 5JaTXbAUmfPYZFRwrYaALK48fN6sFJp4rHqq2QSXs8ucfpE4yQU | |
# 04865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac09ef122b1a986818a7cb624532f062c1d1f8722084861c5c3291ccffef4ec6874 / 5Jb7fCeh1Wtm4yBBg3q3XbT6B525i17kVhy3vMC9AqfR6FH2qGk | |
# 048d2455d2403e08708fc1f556002f1b6cd83f992d085097f9974ab08a28838f07896fbab08f39495e15fa6fad6edbfb1e754e35fa1c7844c41f322a1863d46213 / 5JFjmGo5Fww9p8gvx48qBYDJNAzR9pmH5S389axMtDyPT8ddqmw | |
# First: combine the three keys into a multisig address: | |
./bitcoind createmultisig 2 '["0491bba2510912a5bd37da1fb5b1673010e43d2c6d812c514e91bfa9f2eb129e1c183329db55bd868e209aac2fbc02cb33d98fe74bf23f0c235d6126b1d8334f86","04865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac09ef122b1a9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -x | |
if [[ $# -eq 0 ]] ; then | |
echo 'Usage: cmd <s3 path> <redirect-location>' | |
echo 'e.g.' | |
echo 'redirect-url-s3.sh www.fullstackreact.com/r/react-from-zero-satisfaction https://nate177.typeform.com/to/PTJ9ZI' | |
exit 0 | |
fi | |
S3_PATH=$1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; lein dep: [net.htmlparser.jericho/jericho-html "3.1"] | |
(ns foo.preprocess | |
(:import | |
[java.io File BufferedInputStream FileInputStream] | |
[net.htmlparser.jericho Source TextExtractor])) | |
(def filename "data/raw-html/cosmetiquemedspa.com/index.html") | |
(def file (java.io.File. filename)) | |
(def source (Source. (BufferedInputStream. (FileInputStream. file)))) | |
(def tex (TextExtractor. source)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.markdown-body .highlight pre, | |
table.highlight, | |
.blob-code-inner { | |
font-family: "Operator Mono"; | |
font-weight: 400; | |
line-height: 1.5em; | |
font-size: 14px; | |
} | |
.markdown-body .highlight pre, | |
table.highlight { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe "GraphExperiments" do | |
JungGraph = Java::EduUciIcsJungGraph | |
before(:each) do | |
n = LazyList[1..Infinity] | |
@tree = JungGraph::DelegateTree.new | |
@tree.setRoot("root") | |
@tree.addChild(n.next, "root", "a") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- osascript services.scpt | |
tell application "iTerm 3" | |
activate | |
set myterm to (create window with default profile) | |
tell myterm | |
set mysession to (current session) | |
tell mysession | |
set name to "geth" | |
write text "cd ~/projects/fs/newline/newline-content-internal/fullstack-web3/private-net" | |
write text "./bin/geth --datadir=./datadir --nodiscover --rpc --rpcapi \"db,personal,eth,net,web3,debug\" --rpccorsdomain='*' --rpcaddr=\"localhost\" --rpcport 8545 --ws --wsapi \"db,personal,eth,net,web3,debug\" --wsorigins='*' --wsaddr=\"localhost\" --wsport 8546 console" |