Skip to content

Instantly share code, notes, and snippets.

View taylor-shift's full-sized avatar

Luis Roel taylor-shift

  • Roseville, CA
View GitHub Profile
@simolus3
simolus3 / main.dart
Created March 28, 2019 18:16
Displays the current balance of a given ethereum address
import 'package:flutter/material.dart';
import 'package:http/http.dart';
import 'package:web3dart/web3dart.dart';
void main() {
runApp(MaterialApp(
home: EthApp(),
theme: ThemeData(
primaryColor: Colors.orange,
typography: Typography(
@wronk
wronk / python_environment_setup.md
Last active November 27, 2023 16:18
Setting up your python development environment (with pyenv, virtualenv, and virtualenvwrapper)

Overview of Python Virtual Environments

This guide is targetted at intermediate or expert users who want low-level control over their Python environments.

When you're working on multiple coding projects, you might want a couple different version of Python and/or modules installed. This helps keep each workflow in its own sandbox instead of trying to juggle multiple projects (each with different dependencies) on your system's version of Python. The guide here covers one way to handle multiple Python versions and Python environments on your own (i.e., without a package manager like conda). See the Using the workflow section to view the end result.


h/t @sharkinsspatial for linking me to the perfect cartoon

@fgilio
fgilio / axios-catch-error.js
Last active April 11, 2024 19:02
Catch request errors with Axios
/*
* Handling Errors using async/await
* Has to be used inside an async function
*/
try {
const response = await axios.get('https://your.site/api/v1/bla/ble/bli');
// Success 🎉
console.log(response);
} catch (error) {
// Error 😨
@purp
purp / README.md
Last active August 12, 2021 20:49
Debug Travis CI config locally using Docker

Debugging Travis CI locally using Docker

This assumes you've got docker-machine installed, running, and can do docker run

1. Get a debug instance running

    docker run --name travis-debug -dit quay.io/travisci/travis-ruby /sbin/init
    docker exec -it travis-debug bash -l
@natdm
natdm / goroutines.go
Created July 20, 2016 14:00
Explaining how to make DB calls with goroutines and waitgroups.
//GetTransactionsAndLinesForBidder hits the database 3 times. Let's make that fast.
func (db *DB) GetTransactionsAndLinesForBidder(bidderID int) ([]BidderTransaction, error) {
//Establish a waitgroup. This has 3 functions only. Add, Wait, and Done. You add to the WaitGroup and hit Done when you are
// done with a process. It will stop the function at Wait until the WaitGroup is at 0.
var wg sync.WaitGroup
//Get the transaction 'shell'
trans, err := db.GetTransactionsForBidder(bidderID)
if err != nil {