Skip to content

Instantly share code, notes, and snippets.

View GabrielNicolasAvellaneda's full-sized avatar
🎯
Focusing

Gabriel Nicolas Avellaneda GabrielNicolasAvellaneda

🎯
Focusing
View GitHub Profile
@GabrielNicolasAvellaneda
GabrielNicolasAvellaneda / android-adb-pull-apk.md
Created May 25, 2021 03:28 — forked from ctrl-freak/android-adb-pull-apk.md
Retrieve APK from Non-Rooted Android Device through ADB

https://stackoverflow.com/a/18003462/348146

None of these suggestions worked for me, because Android was appending a sequence number to the package name to produce the final APK file name (this may vary with the version of Android OS). The following sequence of commands is what worked for me on a non-rooted device:

  1. Determine the package name of the app, e.g. com.example.someapp. Skip this step if you already know the package name.

    adb shell pm list packages

    Look through the list of package names and try to find a match between the app in question and the package name. This is usually easy, but note that the package name can be completely unrelated to the app name. If you can't recognize the app from the list of package names, try finding the app in Google Play using a browser. The URL for an app in Google Play contains the package name.

#!/bin/bash
function cardano-address-init() {
WALLETS_DIR=${HOME}/.cardano/wallets
MNEMONICS_SIZE=24
}
function cardano-address-testnet-init() {
@GabrielNicolasAvellaneda
GabrielNicolasAvellaneda / shelley_staking_gen.md
Created May 16, 2021 04:11 — forked from ilap/shelley_staking_gen.md
Extracting Pool Staking keys from Daedalus/Yoroi wallet

Intorduction

DISCLAIMER: NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK

UPDATED: 14:08am AEST 29/Sept/2020, The IDX was incorrectly used. Fixed now

There are two keypairs that are required to register a pool:

  1. reward account (costs and rewards) and
  2. owner stake (pledge) keypair.
@GabrielNicolasAvellaneda
GabrielNicolasAvellaneda / Playground.hs
Created March 29, 2021 02:23
Plutus Playground Smart Contract
-- A game with two players. Player 1 thinks of a secret word
-- and uses its hash, and the game validator script, to lock
-- some funds (the prize) in a pay-to-script transaction output.
-- Player 2 guesses the word by attempting to spend the transaction
-- output. If the guess is correct, the validator script releases the funds.
-- If it isn't, the funds stay locked.
import Control.Monad (void)
import qualified Data.ByteString.Char8 as C
import Language.Plutus.Contract
import qualified Language.PlutusTx as PlutusTx
@GabrielNicolasAvellaneda
GabrielNicolasAvellaneda / Playground.hs
Last active March 29, 2021 01:27
Plutus Playground Smart Contract
-- Get the PubKeyHash type
import Control.Monad (void)
import Ledger
import Data.Aeson (FromJSON, ToJSON)
import qualified Language.PlutusTx as PlutusTx
import qualified Ledger.Ada as Ada
import qualified Ledger.Typed.Scripts as Scripts
import Wallet.Emulator.Wallet
import Playground.Contract
import qualified Data.Text as T
{
"data": {
"datasets": [
{
"backgroundColor": [
"rgb(255, 99, 132)",
"rgb(54, 162, 235)",
"rgb(255, 205, 86)"
],
"data": [
@GabrielNicolasAvellaneda
GabrielNicolasAvellaneda / sqlite-tables.sh
Created May 5, 2020 17:55
[sqlite shell to list tables]
sqlite3 file.db
.TABLES
@GabrielNicolasAvellaneda
GabrielNicolasAvellaneda / .gitignore
Created May 5, 2020 17:43
[GIT ignore all but a specific folder]
/*
!/some-folder
@GabrielNicolasAvellaneda
GabrielNicolasAvellaneda / minikube-start.sh
Created December 6, 2018 16:59
Minikube 8 Cpus 32Gb of RAM
#!/bin/bash
minikube start --memory $(expr 32 \* 1024) --cpus 8
const partition = (list, partitioner) => {
const toIndex = (el) => (partitioner(el)) ? 0 : 1;
const toPartition = (result, el) => {
result[toIndex(el)].push(el)
return result;
}
return list.reduce(toPartition, [[],[]]);
}