Skip to content

Instantly share code, notes, and snippets.

{
"Ansi 2 Color" : {
"Green Component" : 0.73333334922790527,
"Red Component" : 0,
"Blue Component" : 0
},
"Tags" : [
],
"Ansi 12 Color" : {
@mikepaszkiewicz
mikepaszkiewicz / gist:073440a413f71b37b1160db892ff9705
Created January 4, 2018 17:35
Snips: PostgreSQL - Create searchable text index on integer field
create index concurrently on transactions (order_number) USING GIN(order_number::text gin_trgm_ops)
@mikepaszkiewicz
mikepaszkiewicz / send.js
Created January 3, 2018 02:15
Raiblocks add send block to account
//NOTE: Connection = promisified wrapper around RPC calls...methods map directly to RPC 'action' parameter
import Rai from '../server/util/rai'
const Connection = Rai('http://000.000.000.000', 7076) //node IP and port
const SENDER_XRB_WALLET_ADDRESS = 'xrb_...'
const RECEIVING_WALLET = 'xrb_...'
const SENDER_PUBLIC_WALLET_KEY = '....'
async function sendBlock() {
try {
@mikepaszkiewicz
mikepaszkiewicz / keybase.md
Created October 4, 2017 14:41
keybase.md

Keybase proof

I hereby claim:

  • I am mikepaszkiewicz on github.
  • I am mikepasz (https://keybase.io/mikepasz) on keybase.
  • I have a public key whose fingerprint is A22A 9F13 58D2 57B8 10CE 9584 3A0D 55B7 3902 58E4

To claim this, I am signing this object:

Staffjoy Suite Cron Docs: https://github.com/mikepaszkiewicz/staffing.tryhabitat.com#required-and-optional-services
curl --user API_KEY: http://staffing.tryhabitat.com/api/v2/internal/cron/
Server Error on cron run:
ERROR Exception on /api/v2/organizations/1/locations/2/roles/3/users/182
[GET] Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1473, in full_dispatch_request rv = self.preprocess_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1666, in preprocess_request rv = func()
@mikepaszkiewicz
mikepaszkiewicz / dispatch.orders.post
Last active July 19, 2017 02:20
dispatch.orders.post
curl -XPOST 'https://sandbox.tryhabitat.com/api/v1/orders' -H "Content-type: application/json" -d '{
"externalId": 1876,
"externalVendorId": 101,
"sellerId": "gRWS4txHe3g43AtNm",
"method": "Delivery",
"deliveryAddress": "2198 N Broad St",
"status": "pending_runner",
"customer":{
"name": "Tyler Wiest",
"phone": "2169052356",
@mikepaszkiewicz
mikepaszkiewicz / docker_install.sh
Created July 11, 2017 19:09
Installing docker on fresh server
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - &&
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" &&
sudo apt-get update &&
apt-cache policy docker-ce &&
sudo apt-get install -y docker-ce &&
sudo systemctl status docker &&
sudo usermod -aG docker jenkins &&
su - jenkins
curl -X GET https://dispatch.tryhabitat.com/api/v1/rates/ \
-H 'cache-control: no-cache' \
-H 'Content-Type: application/json' \
-d '{ "api_key": "YOUR_API_KEY",
"vendorId": "VENDOR_ID",
"destination": "ADDRESS_OR_COORDS"
"bagCount": "NUMBER_OF_DELIVERY_BAGS"
"allowedTransport": "[Walk,Skate,Bike,DeliveryBike,Car,Van]"
}'
@mikepaszkiewicz
mikepaszkiewicz / dispatch.menus.get
Last active June 26, 2017 18:41
Fetch a vendor menu from habitat
// vendorId is optional, and will return an array of all menus if not present
curl -X GET https://dispatch.tryhabitat.com/api/v1/menus/ \
-H 'cache-control: no-cache' \
-H 'Content-Type: application/json' \
-d '{ "api_key": "YOUR_API_KEY", "vendorId": "VENDOR_ID" }'
// returns the following:
{
"_id" : "qkfHaEFiL2oTDgJts",
@mikepaszkiewicz
mikepaszkiewicz / dispatch.vendors.get
Last active June 1, 2017 16:22
dispatch.vendors.get
// vendorId is optional, and will return an array of all businesses if not present
curl -X GET https://dispatch.tryhabitat.com/api/v1/vendors/ \
-H 'cache-control: no-cache' \
-H 'Content-Type: application/json' \
-d '{"api_key": "YOUR_API_KEY", "vendorId": "VENDOR_ID"}'