Skip to content

Instantly share code, notes, and snippets.

View thoughtpalette's full-sized avatar

Christopher Marshall thoughtpalette

View GitHub Profile
@thoughtpalette
thoughtpalette / reset.css
Created December 31, 2022 03:13
Josh's Custom Reset - Modern CSS Reset
/*
Josh's Custom CSS Reset
https://www.joshwcomeau.com/css/custom-css-reset/
*/
*, *::before, *::after {
box-sizing: border-box;
}
* {
margin: 0;
}
lefty semi-pro e-sport athlete kappa
------------------------- Support & Follow -----------------------
http://twitch.tv/vagdis
https://www.youtube.com/user/vagdis/videos
---------- LANs, Tournaments & League History ----------
Rocket League
@thoughtpalette
thoughtpalette / vowel-sort.js
Created December 9, 2019 15:06
Get Vowels from String, Sort and return by Count
var test = "SAMPLE";
function solution(S) {
let stringArr = [...S.toLowerCase()];
let vowelArr = ['a','e','i','o','u'];
const vowelString = stringArr.filter(letter => vowelArr.includes(letter)).sort().join('');
let finalString = '';
vowelArr = vowelArr.map(vowel => {
@thoughtpalette
thoughtpalette / Serverless forms.
Created August 25, 2016 19:03
Gist for serverless forms on G Sheets
// Usage
// 1. Enter sheet name where data is to be written below
var SHEET_NAME = "testform";
// 2. Run > setup
//
// 3. Publish > Deploy as web app
// - enter Project Version name and click 'Save New Version'
// - set security level and enable service (most likely execute as 'me' and access 'anyone, even anonymously)
//
/**
Copyright 2014-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at
http://aws.amazon.com/apache2.0/
or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/
@thoughtpalette
thoughtpalette / s3_public_bucket.txt
Created March 18, 2016 20:25
Bucket policy for AWS S3 to make assets available publicly.
{
"Version":"2008-10-17",
"Statement":[{
"Sid":"AllowPublicRead",
"Effect":"Allow",
"Principal": {
"AWS": "*"
},
"Action":["s3:GetObject"],
"Resource":["arn:aws:s3:::YOUR_BUCKET_NAME/*"
@thoughtpalette
thoughtpalette / datascience.R
Last active September 24, 2015 22:36
Line chart in R with CSV import
library(ggplot2)
# Import CSV file, Use default headers, comma delimited
fuck <- read.csv2("Caitlins.csv", header=T, sep=",")
# Assign cats (categories) to first row (x) Which is sample name
cats <- fuck$X;
# x axis(?)
markers <- 1:25
Lifecycle Methods
componentWillMount – Invoked once, on both client & server before rendering occurs.
componentDidMount – Invoked once, only on the client, after rendering occurs.
shouldComponentUpdate – Return value determines whether component should update.
componentWillUnmount – Invoked prior to unmounting component.
Specs
getInitialState – Return value is the initial value for state.
getDefaultProps – Sets fallback props values if props aren’t supplied.
var $updatePasswordContainer = $( ".update-password" ),
$savePasswordBtn = $( ".save-password" ),
$cancelEditBtn = $( ".cancel-password" );
var updatePasswordSection = {
toggle: function( parentEl, initialValue )
{
if( $updatePasswordContainer.hasClass( "editing" ) )
{
var $updatePasswordContainer = $( ".update-password" ),
$savePasswordBtn = $( ".save-password" );
$cancelEditBtn = $( ".cancel-password" );
var updatePasswordSection = {
toggle: function( parentEl, initialValue )
{
if ( $updatePasswordContainer.hasClass( "editing" ) )
{