Skip to content

Instantly share code, notes, and snippets.

View roshnet's full-sized avatar
🏎️
working from cache

Roshan Sharma roshnet

🏎️
working from cache
View GitHub Profile
@PraneshASP
PraneshASP / createWallet.js
Last active March 12, 2024 11:51
Create a bitcoin wallet with this simple script.
//Import dependencies
const bip32 = require('bip32')
const bip39 = require('bip39')
const bitcoin = require('bitcoinjs-lib')
//Define the network
const network = bitcoin.networks.bitcoin //use networks.testnet for testnet
// Derivation path
const path = `m/49'/0'/0'/0` // Use m/49'/1'/0'/0 for testnet
@cecepm
cecepm / install-meslo-fonts.sh
Created April 12, 2021 01:30
Install Meslo Nerd Font patched for Powerlevel10k
mkdir -p ~/.fonts
curl -L https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Regular.ttf --output ~/.fonts/'MesloLGS NF Regular.ttf'
curl -L https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold.ttf --output ~/.fonts/'MesloLGS NF Bold.ttf'
curl -L https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Italic.ttf --output ~/.fonts/'MesloLGS NF Italic.ttf'
curl -L https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold%20Italic.ttf --output ~/.fonts/'MesloLGS NF Bold Italic.ttf'
<template>
<div>
<!-- v-row now provides gutter adjustments and has 3 options available -->
<!-- v1.5 - <v-container grid-list-xl> to v2.0 - regular (nothing required) -->
<!-- v1.5 - <v-container grid-list-md> to v2.0 - <v-row dense> -->
<!-- v1.5 - <v-container> to v2.0 - <v-row no-gutters> -->
<!-- v1.5 -->
<v-container grid-list-xl>
<v-layout>
@sergiolucero
sergiolucero / graphqlapp.py
Created June 20, 2019 13:33
basic flask-graphql app
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
import os
import graphene
from graphene_sqlalchemy import SQLAlchemyObjectType, SQLAlchemyConnectionField
from flask_graphql import GraphQLView
#################################
app = Flask(__name__)
app.debug = True
@robinp
robinp / github-vertical-unspace.user.css
Last active April 17, 2020 07:19
Stylus script for to make github code review vertically more compact.
/* Remove below comment in Stylus */
// Install Stylus, a minimal permissions CSS-modifier: https://chrome.google.com/webstore/detail/stylus/clngdbkpkpeebahjckkjfobafhncgmne//
// Set to use regex match https://github.com/.*/pull/.*/files
// also https://github.com/.*/commit/.*#diff-.*
body {
font-size: 12px;
}
.blob-num {
function App() {
const [count, setCount] = useState(0);
const [message, setMessage] = useState("");
function increment() {
setCount(count + 1);
setMessage(`count is ${count}`);
}
function decrement() {
@anned20
anned20 / encryption.js
Last active June 1, 2023 11:45
Encrypting files with NodeJS
const crypto = require('crypto');
const algorithm = 'aes-256-ctr';
let key = 'MySuperSecretKey';
key = crypto.createHash('sha256').update(String(key)).digest('base64').substr(0, 32);
const encrypt = (buffer) => {
// Create an initialization vector
const iv = crypto.randomBytes(16);
// Create a new cipher using the algorithm, key, and iv
const cipher = crypto.createCipheriv(algorithm, key, iv);
package main
import (
"flag"
"log"
"net/http"
"strings"
)
// FileSystem custom file system handler
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active May 7, 2024 21:31
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@nikhita
nikhita / update-golang.md
Last active April 27, 2024 13:09
How to update the Go version

How to update the Go version

System: Debian/Ubuntu/Fedora. Might work for others as well.

1. Uninstall the exisiting version

As mentioned here, to update a go version you will first need to uninstall the original version.

To uninstall, delete the /usr/local/go directory by: