Skip to content

Instantly share code, notes, and snippets.

View mihaiserban's full-sized avatar
💭
👨🏻‍💻✨

Mihai Serban mihaiserban

💭
👨🏻‍💻✨
View GitHub Profile
@mihaiserban
mihaiserban / button.js
Last active December 3, 2018 11:40
Button example v2
/* global window */
import React from "react";
import classNames from "classnames";
const Button = ({
dark,
light,
disabled = false,
onPressed,
width = 200,
@mihaiserban
mihaiserban / payments.js
Created December 7, 2018 18:40
braintree payments stream search transactions
router.get('/payments', verifyJWT_MW, function(req, res) {
try {
let transactions = [];
const stream = Braintree.gateway.transaction.search(function(search) {
search.customerId().is(req.user.account.braintreeCustomerId);
});
stream.on('ready', function() {
console.log(stream.searchResponse.length());
@mihaiserban
mihaiserban / sync_fork.md
Created March 1, 2019 11:42
Sync a github repo from the original fork
  1. Clone your favorite project:

git clone https://github.com/teleporthq/teleport-code-generators.git

  1. Add remonte branch:

git remote add --track master teleporthq https://github.com/teleporthq/teleport-code-generators.git

  1. Verify if the remote was added:
@mihaiserban
mihaiserban / .ebignore
Created March 15, 2019 21:25
deploy Next.JS on AWS Elastic Beanstalk using YARN as package manager
node_modules
@mihaiserban
mihaiserban / custom_scrollbar.css
Created April 1, 2019 10:58
custom scrollbar ::-webkit-scrollbar
/* total width */
::-webkit-scrollbar {
width: 14px;
}
::-webkit-scrollbar-track {
box-shadow: inset 0 0 14px 14px transparent;
border: solid 4px transparent;
}
@mihaiserban
mihaiserban / image-react.js
Last active May 17, 2019 09:06
React image fallback - in case src fails try to load a placeholder instead
import React from "react";
import PropTypes from "prop-types";
class Image extends React.Component {
constructor(props) {
super(props);
this.state = { src: props.src };
}
componentWillReceiveProps(nextProps) {
Calibrate probe
PROBE_CALIBRATE
TESTZ Z=-.1
ACCEPT
SAVE_CONFIG
SET_GCODE_OFFSET Z=+.010
@mihaiserban
mihaiserban / 00_README.md
Created November 29, 2021 19:36 — forked from LeZuse/00_README.md
Install node on Apple Silicon M1 both ARM and x86 (Rosetta)

Node.js on Apple Silicon

Node Version Manager (https://github.com/nvm-sh/nvm) works perfectly across native node installations as well as emulated Rosetta installations. The trick I am using here is to install one LTS version of node under Rosetta and another stable version as native binary.

TODO

  • find a way how to run the same node version on both platforms
@mihaiserban
mihaiserban / mint.js
Created December 7, 2021 10:27 — forked from zurgl/mint.js
solana js examples
const web3 = require('@solana/web3.js');
const splToken = require('@solana/spl-token');
(async () => {
//create connection to devnet
const connection = new web3.Connection(web3.clusterApiUrl("devnet"));
//generate keypair and airdrop 1000000000 Lamports (1 SOL)
const myKeypair = web3.Keypair.generate();
@mihaiserban
mihaiserban / snippets.js
Created December 7, 2021 10:28 — forked from beautyfree/snippets.js
Solana Web3 Snippets
import {
Account,
clusterApiUrl,
Connection,
PublicKey,
sendAndConfirmTransaction,
SystemProgram,
Transaction,
} from '@solana/web3.js';