Skip to content

Instantly share code, notes, and snippets.

View saintsal's full-sized avatar

Salim Virani saintsal

View GitHub Profile
@z0r0z
z0r0z / ClubSig.sol
Last active September 24, 2022 19:47
EIP-712-signed multi-signature contract with NFT identifiers for signers and ragequit
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.4;
import "https://github.com/Rari-Capital/solmate/src/tokens/ERC721.sol";
import "https://github.com/kalidao/kali-contracts/blob/main/contracts/utils/NFThelper.sol";
/// @notice Minimal ERC-20 interface.
interface IERC20minimal {
function balanceOf(address account) external view returns (uint256);
@joshnuss
joshnuss / httpStore.js
Last active October 11, 2023 11:29
A Svelte store backed by HTTP
import { writable } from 'svelte/store'
// returns a store with HTTP access functions for get, post, patch, delete
// anytime an HTTP request is made, the store is updated and all subscribers are notified.
export default function(initial) {
// create the underlying store
const store = writable(initial)
// define a request function that will do `fetch` and update store when request finishes
store.request = async (method, url, params=null) => {
@yafkari
yafkari / sitemap.xml.js
Created January 19, 2020 11:16
Simple sitemap.xml file for Svelte/Sapper blog project
import posts from "./blog/_posts";
const fs = require('fs');
const BASE_URL = "https://www.zechtyounes.tech"; // TO CHANGE
const pages = [""];
fs.readdirSync("./src/routes").forEach(file => {
file = file.split('.')[0];
if (file.charAt(0) !== '_' && file !== "sitemap" && file !== "index") {
pages.push(file);
# Generate linear fit and chart 1
slope, intercept, r_value, p_value, std_err = stats.linregress(
seasonal_df['rebound_ratio'], seasonal_df['win'])
line = slope * seasonal_df['rebound_ratio'].values + intercept
ch1_data = go.Scatter(
x=seasonal_df['rebound_ratio'].values,
y=seasonal_df['win'].values,
mode='markers',
marker=go.Marker(color='rgb(255, 127, 14)'),
@killercup
killercup / pandoc.css
Created July 3, 2013 11:31
Add this to your Pandoc HTML documents using `--css pandoc.css` to make them look more awesome. (Tested with Markdown and LaTeX.)
/*
* I add this to html files generated with pandoc.
*/
html {
font-size: 100%;
overflow-y: scroll;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
@cobyism
cobyism / gh-pages-deploy.md
Last active July 5, 2024 05:07
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@ryangray
ryangray / buttondown.css
Created February 22, 2012 06:45
A clean, minimal CSS stylesheet for Markdown, Pandoc and MultiMarkdown HTML output.
/*
Buttondown
A Markdown/MultiMarkdown/Pandoc HTML output CSS stylesheet
Author: Ryan Gray
Date: 15 Feb 2011
Revised: 21 Feb 2012
General style is clean, with minimal re-definition of the defaults or
overrides of user font settings. The body text and header styles are
left alone except title, author and date classes are centered. A Pandoc TOC