Skip to content

Instantly share code, notes, and snippets.

View CanRau's full-sized avatar
🤓
coding

Can Rau CanRau

🤓
coding
View GitHub Profile
@mw-ferretti
mw-ferretti / README.md
Last active January 28, 2023 20:44
Paypal button on markdown github

Steps:

<!-- Sample of code generated --> 
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="RGQ8NSYPA59FL">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/pt_BR/i/scr/pixel.gif" width="1" height="1">
@DarrenN
DarrenN / get-npm-package-version
Last active April 17, 2024 16:57 — forked from yvele/get-npm-package-version.sh
Extract version from package.json (NPM) using bash / shell
# Version key/value should be on his own line
PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g')
echo $PACKAGE_VERSION
@kentcdodds
kentcdodds / README.md
Created October 25, 2017 22:01
Rendering a function with React

Rendering a function with React

No, this isn't about render props

I'm going to clean this up and publish it in my newsletter next week!

Context

So react-i18n (not the npm one... one we made at PayPal internally) has this

@akehrer
akehrer / sqlite_to_json.sql
Created January 9, 2018 19:58
SQLite Results as JSON using the SQLite JSON1 extension
-- When SQLite is compiled with the JSON1 extensions it provides builtin tools
-- for manipulating JSON data stored in the database.
-- This is a gist showing SQLite return query data as a JSON object.
-- https://www.sqlite.org/json1.html
-- An example table with some data
CREATE TABLE users (
id INTEGER PRIMARY KEY NOT NULL,
full_name TEXT NOT NULL,
email TEXT NOT NULL,
@bcnzer
bcnzer / cloudflareworker-verifyjwt.js
Last active March 21, 2024 14:09
Sample Cloudflare worker that gets the JWT, ensures it hasn't expired, decrypts it and returns a result
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
// Following code is a modified version of that found at https://blog.cloudflare.com/dronedeploy-and-cloudflare-workers/
/**
* Fetch and log a request
* @param {Request} request
*/
@CanRau
CanRau / gtm-utm-remover.js
Last active April 22, 2019 04:11
Removes all query parameters from the url beginning with 'utm_', leaves anchors (#) and other query params alone
/**
* GTM utm_ remover
* License: MIT
* Author: @CanRau
* Version: 0.2.0
*
* Removes all query parameters from the url beginning with 'utm_'
* Leaves anchors (#) and other query params alone, so
* example.com/?session=SESSIONID&utm_source=instagram#content
* would become

Keybase proof

I hereby claim:

  • I am canrau on github.
  • I am canrau (https://keybase.io/canrau) on keybase.
  • I have a public key ASDcjXYRMtWtmJKpTow9SS7FahCJbrnILp30C51yJrH_7Ao

To claim this, I am signing this object:

@CanRau
CanRau / Basics.md
Last active March 12, 2023 21:32
[SQLite Notes] #SQLite

insert multiple

INSERT INTO table1 (column1,column2 ,..)
VALUES 
   (value1,value2 ,...),
   (value1,value2 ,...),
    ...
   (value1,value2 ,...);
@JakeGinnivan
JakeGinnivan / Pulumi.yaml
Last active January 12, 2023 10:17
Pulumi /w TypeScript project references + dynamodb lock
name: serverless-mono
description: Serverless mono infrastructure
backend:
url: s3://my-pulumi-state-bucket
runtime:
name: nodejs
options:
typescript: false
lock:
region: ap-southeast-2
@andrelandgraf
andrelandgraf / createSitemap.ts
Last active January 29, 2024 08:36
sitemap.xml generator for remix.run
import childProcess from 'child_process';
import fs from 'fs';
import dotenv from 'dotenv';
import prettier from 'prettier';
const rootDir = process.cwd();
dotenv.config({
path: `${rootDir}/.env.production`,
});