Skip to content

Instantly share code, notes, and snippets.

Avatar
🌴
For the rainforest 💪

Can Rau CanRau

🌴
For the rainforest 💪
View GitHub Profile
@CanRau
CanRau / Basics.md
Last active Nov 4, 2019
[SQLite Notes] #SQLite
View Basics.md

insert multiple

INSERT INTO table1 (column1,column2 ,..)
VALUES 
   (value1,value2 ,...),
   (value1,value2 ,...),
    ...
   (value1,value2 ,...);
View keybase.md

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 / gtm-utm-remover.js
Last active Apr 22, 2019
Removes all query parameters from the url beginning with 'utm_', leaves anchors (#) and other query params alone
View gtm-utm-remover.js
/**
* 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
@CanRau
CanRau / README.md
Created Nov 26, 2018 — forked from kentcdodds/README.md
Rendering a function with React
View README.md

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

View wrapper.js
class MyWrapper {
return React.Children.only(this.props.children);
}
class MyLibraryComponent {
render() {
return <div><span><whatever><MyWrapper ref=...>{this.props.statelessComponentThatIWantToReference}</MyWrapper></whatever></span></div>;
}
@CanRau
CanRau / README.md
Created Oct 16, 2018 — forked from mw-ferretti/README.md
Paypal button on markdown github
View README.md

###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">
View socialmedia-static-share-links.txt
@CanRau
CanRau / get-npm-package-version
Created Aug 15, 2018 — forked from DarrenN/get-npm-package-version
Extract version from package.json (NPM) using bash / shell
View get-npm-package-version
# 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
@CanRau
CanRau / stripe-currencies.js
Created Jul 27, 2018 — forked from chrisdavies/stripe-currencies.js
A handy list of currency codes and descriptions for use with Stripe.
View stripe-currencies.js
'use strict';
// The STRIPE-supported currencies, sorted by code
export const currencies = [
{
'code':'AED',
'description':'United Arab Emirates Dirham'
},
{
'code':'AFN',
@CanRau
CanRau / parseURLParameters.js
Last active Mar 20, 2018 — forked from pirate/parseURLParameters.js
Parse URL query parameters in ES6 (immutable version using reduce instead of map)
View parseURLParameters.js
const getUrlParams = (search = ``) => {
const hashes = search.slice(search.indexOf(`?`) + 1).split(`&`)
return hashes.reduce((acc, hash) => {
const [key, val] = hash.split(`=`)
return {
...acc,
val: decodeURIComponent(val)
}
}, {})
}