value = [3, 4, 5, 6]
longer_value = [3, 4, 5, 6, 8]
iter_value = iter(value)
print([*value])
# >>> [3, 4, 5, 6]
print([*value]*2)
# >>> [3, 4, 5, 6, 3, 4, 5, 6]
print([*iter(value)]*2)
This file contains hidden or 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/sh | |
# This command installs binaries at specified versions | |
# into $GOBIN, $GOPATH/bin or $HOME/bin. | |
# It assumes Go 1.11. | |
if [ $# = 0 ]; then | |
usage: vgoget cmdpackage[@version]... >&2 | |
exit 2 | |
fi | |
d=`mktemp -d` | |
cd "$d" |
This file contains hidden or 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
/** | |
* Prints out the keys that changed and their old and new values. Useful for deeply | |
* nested objects. | |
* Bare minimum Typescript annotations to pass compiling | |
**/ | |
import _ from 'lodash'; | |
import { useEffect, useRef } from 'react'; | |
const isObject = (v: any) => v && typeof v === 'object'; |
This file contains hidden or 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 | |
tabname() { | |
printf "\e]1;$1\a" | |
} | |
new_tab() { | |
TAB_NAME=$1 | |
COMMAND=$2 | |
osascript \ |
This file contains hidden or 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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.10; | |
import "@openzeppelin/contracts-upgradeable/token/ERC1155/ERC1155Upgradeable.sol"; | |
import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; | |
import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; | |
import "@openzeppelin/contracts-upgradeable/token/ERC1155/extensions/ERC1155BurnableUpgradeable.sol"; | |
import "@openzeppelin/contracts-upgradeable/token/ERC1155/extensions/ERC1155SupplyUpgradeable.sol"; | |
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; | |
import "@openzeppelin/contracts/utils/Strings.sol"; |
This file contains hidden or 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
<template> | |
<div>Hi I am the about page {{ info }}</div> | |
</template> | |
<script> | |
export default { | |
props: { | |
info: String | |
}, | |
beforeRouteEnter(to, from, next) { |
This file contains hidden or 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
import { GtmInstance } from './types' | |
// will need this for multiple container environments | |
export default ({ $gtm }: { $gtm: GtmInstance }) => { | |
const gtagId = process.env.GOOGLE_TAG_MANAGER_ID | |
if (gtagId) { | |
$gtm.init(gtagId) | |
$gtm.push({ event: 'gtm.js', 'gtm.start': new Date().getTime() }) | |
} | |
} |
A brief example on how to use npx
to run gist based scripts.
Read the article here https://neutrondev.com/npm-vs-npx-whats-the-difference/
This file contains hidden or 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
{ | |
// Use IntelliSense to learn about possible attributes. | |
// Hover to view descriptions of existing attributes. | |
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Python: Current File", | |
"type": "python", | |
"request": "launch", |
NewerOlder