Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View rbk's full-sized avatar

Richard Keller rbk

View GitHub Profile
@rbk
rbk / App.js
Created June 28, 2019 00:28
React Native Valid Style Props
[
"alignContent",
"alignItems",
"alignSelf",
"aspectRatio",
"backfaceVisibility",
"backgroundColor",
"borderBottomColor",
"borderBottomEndRadius",
"borderBottomLeftRadius",
@rbk
rbk / ExtraArgs-Reference.py
Created June 22, 2019 14:01
S3 argument reference for S3 operations including upload.
response = client.copy_object(
ACL='private'|'public-read'|'public-read-write'|'authenticated-read'|'aws-exec-read'|'bucket-owner-read'|'bucket-owner-full-control',
Bucket='string',
CacheControl='string',
ContentDisposition='string',
ContentEncoding='string',
ContentLanguage='string',
ContentType='string',
CopySource='string' or {'Bucket': 'string', 'Key': 'string', 'VersionId': 'string'},
CopySourceIfMatch='string',
@rbk
rbk / App.js
Created June 16, 2019 19:42
React Native Tutorial #1 - Render - 01
render() {
return (
<View>
<View>
<Text>Meditation Timer</Text>
</View>
<Text>10:00</Text>
<Text>Close your eyes, relax, and breath naturally.</Text>
<TouchableOpacity >
<Text>Begin Session</Text>
@rbk
rbk / web-colors.json
Created March 30, 2019 20:46
Web colors (names)
[
"AliceBlue ",
"AntiqueWhite ",
"Aqua ",
"Aquamarine ",
"Azure ",
"Beige ",
"Bisque ",
"Black ",
"BlanchedAlmond ",
@rbk
rbk / main.py
Last active April 9, 2019 17:02
Json to CSV
import sys
import json
input_file = sys.argv[len(sys.argv)-1]
print('INPUT: ', input_file)
output_file = input_file + '.csv'
data = json.loads(open(input_file).read())
# print(",".join(list(data[0].keys())))
csv_headers = ",".join(list(data[0].keys()))
with open(output_file, 'w') as f:
f.write(csv_headers + '\n')
#Update system
sudo apt-get update
sudo apt-get upgrade -y
#Install Apache2
sudo apt-get install apache2 -y
sudo a2enmod rewrite
sudo service apache2 restart
#Install PHP
@rbk
rbk / rest-api-doc-example.md
Last active June 7, 2019 19:40
Example of REST API documentation (Based on Twitter, 2018)
@rbk
rbk / pymysql-connect.py
Created March 23, 2018 13:14
Connect to MySQL via PyMysql
import pymysql
connection = pymysql.connect(host='<ip-or-domain>',
user='<dbuser>',
password='<dbpass>',
db='<dbname>',
charset='utf8mb4',
cursorclass=pymysql.cursors.DictCursor,
autocommit=True)
@rbk
rbk / sizecheck.js
Created July 27, 2017 18:13
Find out if any elements are wider that the screen size.
function findElementsLargerThanScreen() {
var elements = document.querySelectorAll('*')
for (var i = 0; i < elements.length; i++) {
var elementWidthInt = 0;
var elementWidth = window.getComputedStyle(elements[i], null).width
if (elementWidth !== 'auto') {
elementWidthInt = parseFloat(elementWidth.replace('px', ''));
if (elementWidthInt > screen.width) {
console.log(elementWidthInt)
} else {
@rbk
rbk / gist:d516d5d96e2116a4a614ebb0ae8a306f
Created May 2, 2017 20:18
Setup a server from scratch for Drupal 8 - Ubuntu 16
1. install mysql, apache2, php-cli, php
- apt-get install php7.0-cli
- apt-get install php7.0 libapache2-mod-php7.0 php7.0-gd php7.0-xml php7.0-mysql
- apt-get install apache2 apache2-doc apache2-utils
- apt-get install mysql-server
- apt-get install zip unzip
- apt-get install mailutils # setup required
3. download d8