Skip to content

Instantly share code, notes, and snippets.

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

Ismail Ghallou smakosh

👨‍💻
Building https://starlink-prices.com
View GitHub Profile
@othmane-kinane-nw
othmane-kinane-nw / detect-case-sensitivity-issues-in-paths.sh
Last active August 29, 2024 19:51
Detect file and directory paths in a git repo that differ only by case
#!/bin/bash
set -e
shopt -s expand_aliases
XARGS_MAX_CMD_LENGTH=`echo | xargs --show-limits 2>&1 | awk '/POSIX upper limit on argument length/ {print $NF}'`
echo "Checking paths under '$PWD' for case related problems..."
alias sort_case_insensitive='sort -f'
alias uniq_show_grouped_duplicates='uniq -i --all-repeated=separate'
@dabit3
dabit3 / marketplace.sol
Last active November 8, 2024 01:09
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 August 19, 2024 22:39 — 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 September 7, 2024 14:46
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 November 15, 2024 17:06
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 November 14, 2024 08:31
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