Skip to content

Instantly share code, notes, and snippets.

View smakosh's full-sized avatar
👨‍💻
Building https://ontwik-dev.com

Ismail Ghallou smakosh

👨‍💻
Building https://ontwik-dev.com
View GitHub Profile
@dabit3
dabit3 / marketplace.sol
Last active March 14, 2024 15:55
NFT Marketplace Smart Contract (V2)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "hardhat/console.sol";
contract NFTMarketplace is ERC721URIStorage {
@yezz123
yezz123 / Deploy.sh
Created February 23, 2022 13:57
Deploy a Website in Tor
#!/bin/bash
install_destination=/opt/epicyon-onion
username='epicyon-onion'
if [[ "$1" == 'remove' ]]; then
echo 'Removing Epicyon onion instance'
systemctl stop tor
rm /etc/torrc.d/epicyon
rm -rf /var/lib/tor/hidden_service_epicyon
systemctl restart tor
@dabit3
dabit3 / connectweb3wallet.js
Created December 1, 2021 16:19
Connecting a web3 wallet
import { ethers } from 'ethers'
import Web3Modal from 'web3modal'
import WalletConnectProvider from '@walletconnect/web3-provider'
async function getWeb3Modal() {
const web3Modal = new Web3Modal({
network: 'mainnet',
cacheProvider: false,
providerOptions: {
walletconnect: {
@jaredpalmer
jaredpalmer / MarkdownPage.tsx
Created February 17, 2021 13:52
Get headers from MDX in Next.js
import {MDXProvider} from '@mdx-js/react';
import {MDXComponents} from 'components/MDX/MDXComponents';
import {Toc} from 'components/Toc/Toc';
import * as React from 'react';
export interface MarkdownProps<Frontmatter> {
meta: Frontmatter;
children?: React.ReactNode;
}
@zephraph
zephraph / npm-canary.md
Last active September 29, 2023 01:19 — forked from schmich/npm-prerelease.md
Publish a canary package on NPM
  • Update package.json by running yarn version --prerelease --preid=canary
  • Run npm publish --tag canary to publish the package under the canary tag
  • Run yarn add @artsy/reaction@canary to install canary package

Running npm dist-tag ls can be helpful to see what tagged packages are available

@FGRibreau
FGRibreau / 1_stripe-schema.md
Last active March 8, 2024 14:57
Stripe database schema (extracted from their sigma product) as of 2019-10-09
jqn -r markdown-table 'map(x => "## " + x.name + "\n\n" + markdownTable(x.columns.map(y => [y.name, y.type]))  ) | join("\n\n")' < /tmp/stripe.json

accounts

id varchar
business_name varchar
business_url varchar
#!/usr/bin/env python
import sys, os, time
import tweepy
keys = dict(
consumer_key='_YOUR_CONSUMER_KEY',
consumer_secret='_YOUR_SECRET_KEY',
access_token='_YOUR_ACCESS_TOKEN',
access_token_secret='_YOUR_ACCESS_TOKEN_SECRET'
)
@bradtraversy
bradtraversy / docker-help.md
Last active April 30, 2024 17:28
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@Jonalogy
Jonalogy / handling_multiple_github_accounts.md
Last active April 29, 2024 13:49
Handling Multiple Github Accounts on MacOS

Handling Multiple Github Accounts on MacOS

The only way I've succeeded so far is to employ SSH.

Assuming you are new to this like me, first I'd like to share with you that your Mac has a SSH config file in a .ssh directory. The config file is where you draw relations of your SSH keys to each GitHub (or Bitbucket) account, and all your SSH keys generated are saved into .ssh directory by default. You can navigate to it by running cd ~/.ssh within your terminal, open the config file with any editor, and it should look something like this:

Host *
 AddKeysToAgent yes

> UseKeyChain yes

@wesbos
wesbos / async-await.js
Created February 22, 2017 14:02
Simple Async/Await Example
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works
const axios = require('axios'); // promised based requests - like fetch()
function getCoffee() {
return new Promise(resolve => {
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee
});
}