Skip to content

Instantly share code, notes, and snippets.

View ivannieto's full-sized avatar
πŸ‘‹

Ivan Nieto ivannieto

πŸ‘‹
View GitHub Profile
@ivannieto
ivannieto / .zshrc
Created February 1, 2022 12:42 — forked from bmhatfield/.zshrc
OSX Keychain Environment Variables
# If you use bash, this technique isn't really zsh specific. Adapt as needed.
source ~/keychain-environment-variables.sh
# AWS configuration example, after doing:
# $ set-keychain-environment-variable AWS_ACCESS_KEY_ID
# provide: "AKIAYOURACCESSKEY"
# $ set-keychain-environment-variable AWS_SECRET_ACCESS_KEY
# provide: "j1/yoursupersecret/password"
export AWS_ACCESS_KEY_ID=$(keychain-environment-variable AWS_ACCESS_KEY_ID);
export AWS_SECRET_ACCESS_KEY=$(keychain-environment-variable AWS_SECRET_ACCESS_KEY);
@ivannieto
ivannieto / influxdb.md
Created October 20, 2020 11:14 — forked from skyrocknroll/influxdb.md
[Influxdb Cardinality Debug] #influxdb
  • SHOW TAG VALUES EXACT CARDINALITY WITH KEY = "index";
  • SHOW SERIES CARDINALITY group by "measurement"; β†’ Important useful one.
  • influxdata/influxdb#8636 β†’ Good examples are here
  • influx_inspect report -detailed /var/lib/influxdb/data/envoy/autogen/903 The best way to ficure out high cardinality series.
  • figure out series in each database use _internal ; select * from "database" where time > now() - 900s limit 10; Faced this error ERR: cannot delete data. DB contains shards using both inmem and tsi1 indexes. Please convert all shards to use the same index type to delete data.
find /var/lib/influxdb -type d -name index | while read index; do rm -Rf "$index" ; done
influx_inspect buildtsi -database envoy -datadir /var/lib/influxdb/data/ -waldir /var/lib/influxdb/wal
@ivannieto
ivannieto / DappToken.sol
Created August 19, 2020 23:19 — forked from gwmccubbin/DappToken.sol
DApp ERC-20 Token
pragma solidity ^0.5.0;
contract Token {
string public name = "DApp Token";
string public symbol = "DAPP";
uint256 public totalSupply = 1000000000000000000000000; // 1 million tokens
uint8 public decimals = 18;
event Transfer(
address indexed _from,
@ivannieto
ivannieto / msi-gtx1060-ubuntu-18.04-deeplearning.md
Created March 25, 2019 21:07 — forked from hereismari/msi-gtx1060-ubuntu-18.04-deeplearning.md
Setting up a MSI laptop with GPU (gtx1060), Installing Ubuntu 18.04, CUDA, CDNN, Pytorch and TensorFlow
@ivannieto
ivannieto / gist:3fbcd4e7a5f558b1e958fce36712d38d
Created March 17, 2018 11:46 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue:

General TDD Advice

  • If you can't test the code efficiently, refactor the code.
  • Don't hardcode URLs in views, templates and tests. (Use revert instead?)
  • Use named views and reverse URL resolution, instead.
  • Never refactor against failing UNIT tests.
  • Don't forget the REFACTOR on 'Red, Green, Refactor'.
  • Tests makes possible using the application state as a save-points for refactors. Once you get to them again, you'll know your refactoring is done.
  • Every single FT doesn't need to test every single part of your application, but use caution when de-duplicating your FTs. (FTs exist to catch unpredictable interactions between different parts of your application, after all)
  • Use loggers named after the module you're in. Follow the logging.getLogger(__filename__) pattern to get a logger that's unique to your module, but that inherits from a top-level configuration you control.
@ivannieto
ivannieto / https.py
Created June 29, 2017 19:46 — forked from stephenlb/https.py
HTTPS Server - All-in-One Secure HTTPS Server
#!/usr/bin/python
# server
# python https.py
#
# browser
# https://0.0.0.0:4443
import BaseHTTPServer
import SimpleHTTPServer
@ivannieto
ivannieto / gitcommands.md
Last active April 6, 2017 16:55 — forked from stuart11n/gist:9628955
Useful git commands

RENAME A BRANCH

git branch -m old_branch new_branch         # Rename branch locally    
git push origin :old_branch                 # Delete the old branch    
git push --set-upstream origin new_branch   # Push the new branch, set local branch to track the new remote

RESET A REMOTE BRANCH TO LOCAL BRANCH STATE

Revert a commit after pushing to remote

.
β”œβ”€β”€ actions
β”œβ”€β”€ stores
β”œβ”€β”€ views
β”‚Β Β  β”œβ”€β”€ Anonymous
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ __tests__
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ views
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ Home
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ __tests__
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”‚Β Β  └── Handler.js