Skip to content

Instantly share code, notes, and snippets.

View ccurtin's full-sized avatar
🤙
makka thangs

Christopher James Curtin ccurtin

🤙
makka thangs
View GitHub Profile
@hopsoft
hopsoft / README.md
Last active January 14, 2024 11:58
Smart Heroku Review Apps managed by GitHub Actions

Smart Heroku Review Apps managed by GitHub Actions

This gist aims to provide a simple solution for managing Heroku Review Apps with GitHub Actions due to the security incident that continues to disrupt Heroku's GitHub integration. Watch the demo to learn more.

Demo Video

.github
├── workflows
│   ├── heroku_review_app_create.yml
@Linch1
Linch1 / tokenPriceApi.js
Last active June 23, 2024 12:49
Retrive the price of any bsc token from it's address without using external service like poocoin/dextools
let pancakeSwapAbi = [
{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"}],"name":"getAmountsOut","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"view","type":"function"},
];
let tokenAbi = [
{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},
];
const Web3 = require('web3');
/*
Required Node.js
@rupeshtiwari
rupeshtiwari / main.yaml
Created March 30, 2021 15:01
cache node_modules in github workflow
name: Caching npm packages
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
@dabit3
dabit3 / schema.graphql
Created November 20, 2019 17:13
17 Access Patterns with GraphQL and AWS Amplify
type Order @model
@key(name: "byCustomerByStatusByDate", fields: ["customerID", "status", "date"])
@key(name: "byCustomerByDate", fields: ["customerID", "date"])
@key(name: "byRepresentativebyDate", fields: ["accountRepresentativeID", "date"])
@key(name: "byProduct", fields: ["productID", "id"])
{
id: ID!
customerID: ID!
accountRepresentativeID: ID!
productID: ID!
@AsyncWizard
AsyncWizard / trello-md-code-highlight.js
Last active January 5, 2024 11:12
Trello markdown code syntax highlight.
// ==UserScript==
// @name Trello Syntax Highlight
// @namespace https://gist.github.com/AsyncWizard
// @version 0.1
// @description try to take over the world!
// @author AsyncWizard
// @require https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.11.0/highlight.min.js
// @resource https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.11.0/styles/github.min.css
// @match https://trello.com/*
// @grant none
@zcaceres
zcaceres / Error-Handling-Patterns-Express.md
Last active August 3, 2023 13:40
error handling patterns in Express

Handling Errors

Express.js makes it a breeze to handle errors in your routes.

Express lets you centralizes your error-handling through middleware.

Let's look at patterns for how to get the most out of your error-handling.

First, our error-handling middleware looks like this:

@scottopell
scottopell / fix_exfat_drive.md
Last active June 5, 2024 07:56
Fix corrupted exFAT disk macOS/OSX

exFAT support on macOS seems to have some bugs because my external drives with exFAT formatting will randomly get corrupted.

Disk Utility is unable to repair this at first, but the fix is this:

  1. Use diskutil list to find the right drive id.
  2. You want the id under the IDENTIFIER column, it should look like disk1s1
  3. Run sudo fsck_exfat -d <id from above>. eg sudo fsck_exfat -d disk1s3
  4. -d is debug so you'll see all your files output as they're processed.
  5. Answer YES if it gives you the prompt Main boot region needs to be updated. Yes/No?
@tracend
tracend / .readme.md
Last active January 25, 2016 00:18
CSS particles

CSS Particles

Generate particles using CSS transitions

Examples

@Koze
Koze / WebViewGetUserAgent1.m
Last active May 23, 2022 09:49
Getting the user agent
// UIWebView
{
UIWebView *webView = [[UIWebView alloc] init];
[webView loadHTMLString:@"<html></html>" baseURL:nil];
NSString *appName = [webView stringByEvaluatingJavaScriptFromString:@"navigator.appName"];
NSLog(@"%@", appName);
// Netscape
NSString *userAgent = [webView stringByEvaluatingJavaScriptFromString:@"navigator.userAgent"];
@ccschmitz
ccschmitz / install-ssl-apache.md
Created April 19, 2015 19:48
How to install an SSL certificate on an Apache server.

Installing an SSL certificate on Apache

  1. Create a private key:
openssl genrsa 2048 > private-key.pem
  1. Create a Certificate Signing Request (CSR):