Skip to content

Instantly share code, notes, and snippets.

View matthewmorek's full-sized avatar
🙈
Breaking builds

Matthew Morek matthewmorek

🙈
Breaking builds
View GitHub Profile
@mrbrucespringsteen
mrbrucespringsteen / amulet.ts
Last active September 9, 2021 23:01 — forked from shrugs/amulet.ts
amulet verification code
import { utils } from 'ethers'
export interface Amulet {
value: string;
hash: string;
count: number;
}
const getAmuletCount = (hash: string): number => {
const matches = hash.match(/(8)\1*/g);
@bonniss
bonniss / github-search-cheatsheet.md
Last active May 9, 2024 09:20
Github search cheatsheet from official docs.

Github Search Cheat Sheet

GitHub’s search supports a variety of different operations. Here’s a quick cheat sheet for some of the common searches.

For more information, visit our search help section.

Basic search

@juliendargelos
juliendargelos / imagemagick-trim-transparent.sh
Last active October 23, 2023 02:31
Imagemagick command that trims transparent pixels from an image.
convert input.png -trim +repage output.png
@ademilter
ademilter / .storybook
Last active September 7, 2021 12:11
postcss config for storybook
- webpack.config.js
- postcss.config.js
- config.js
- addons.js
@ciaoben
ciaoben / gist:81ae855d3218fbb7a0233fdb1cf07790
Created July 9, 2018 15:04
Create app ejected with raw-loader
"use strict";
const autoprefixer = require("autoprefixer");
const path = require("path");
const webpack = require("webpack");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const CaseSensitivePathsPlugin = require("case-sensitive-paths-webpack-plugin");
const InterpolateHtmlPlugin = require("react-dev-utils/InterpolateHtmlPlugin");
const WatchMissingNodeModulesPlugin = require("react-dev-utils/WatchMissingNodeModulesPlugin");
const eslintFormatter = require("react-dev-utils/eslintFormatter");
@xameeramir
xameeramir / default nginx configuration file
Last active May 23, 2024 17:10
The default nginx configuration file inside /etc/nginx/sites-available/default
# Author: Zameer Ansari
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
@bendc
bendc / simulate-typing.js
Created September 1, 2017 08:57
Fake typing animation
const trackTime = timing => {
const now = performance.now();
if (!timing.startTime) timing.startTime = now;
const elapsed = now - timing.startTime;
const {duration} = timing;
if (duration != null && duration <= elapsed) timing.startTime = null;
return elapsed;
};
const delay = (callback, duration) => {
@brien-crean
brien-crean / twitter_oauth_user_context.js
Created July 14, 2017 18:22
Twitter 3 legged OAuth on AWS Lambda with NodeJS
const OAuth = require('oauth');
const Twit = require('twit');
const nconf = require('nconf');
// temp global var
var oAuthTokenSecret;
// load config file which contains twitter app tokens
nconf.file({ file: './config/twitter-share.json' }).env()
@Yimiprod
Yimiprod / .csscomb.json
Last active May 15, 2020 15:03
smacss definition for scss-lint and csscomb
{
"exclude": [
".git/**",
"node_modules/**"
],
"remove-empty-rulesets": true,
"always-semicolon": true,
"color-case": "lower",
"block-indent": " ",
"color-shorthand": false,
@saurabhshri
saurabhshri / pip.md
Last active September 24, 2023 11:07
Install and use pip in a local directory without root/sudo access.

Install and use pip in a local directory without root/sudo access.

Why?

Many users when are given server access, do not have root (or sudo) privileges and can not simply do sudo apt-get install python-pip . Here's an easy way you can install and use pip without root (or sudo) access in a local directory. Note : This works without easy_install too.

How?