Skip to content

Instantly share code, notes, and snippets.

💭
Rolling my katamari ball

Christopher Pedersen topherPedersen

💭
Rolling my katamari ball
View GitHub Profile
@topherPedersen
topherPedersen / build.gradle
Created Jul 2, 2020
Working build.grade (Sign in with Google Blog Post)
View build.gradle
signingConfigs {
debug {
storeFile file('debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
release {
@topherPedersen
topherPedersen / build.gradle
Created Jul 2, 2020
Broken build.grade (Sign in with Google Blog Post)
View build.gradle
signingConfigs {
release {
if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) {
storeFile file(MYAPP_UPLOAD_STORE_FILE)
storePassword MYAPP_UPLOAD_STORE_PASSWORD
keyAlias MYAPP_UPLOAD_KEY_ALIAS
keyPassword MYAPP_UPLOAD_KEY_PASSWORD
}
}
}
@topherPedersen
topherPedersen / basicLineChart.js
Created Jun 11, 2020
Basic Line Chart in React-Native with VictoryCharts
View basicLineChart.js
import React from 'react';
import {
SafeAreaView,
StyleSheet,
ScrollView,
View,
Text,
StatusBar,
} from 'react-native';
View ReactNativeHyperlink.js
@topherPedersen
topherPedersen / simpleDotMap.js
Created May 24, 2020
Simple JavaScript .map() Method Example
View simpleDotMap.js
let oldArray = ["foo", "bar", "baz"];
let newArray = oldArray.map( (item) => {
if (item === "baz") {
return "B@Z!";
} else {
return item;
}
});
@topherPedersen
topherPedersen / autoFocusTextInputModal.jsx
Last active May 24, 2020
TextInput autoFocus work-around for use in React-Native Modals
View autoFocusTextInputModal.jsx
<Modal
visible={true}
onShow={ () => { this.textInput.focus(); }}>
{/* Adapted From: https://stackoverflow.com/questions/42730400/focus-input-on-load-of-modal-in-react-native */}
<KeyboardAvoidingView style={{}}>
<TextInput
style={{}}
@topherPedersen
topherPedersen / SkipRowInFlatListDemo.js
Last active May 16, 2020
Skip over item or row in React Native FlatList
View SkipRowInFlatListDemo.js
import React from 'react';
import {
SafeAreaView,
StyleSheet,
ScrollView,
View,
Text,
StatusBar,
FlatList,
} from 'react-native';
@topherPedersen
topherPedersen / jumpDemo.js
Created May 13, 2020
Jump! Send a code block to the back of the JavaScript execution stack
View jumpDemo.js
const jump = setTimeout;
function busyWork() {
var myVariable = 0;
for (var i = 0; i < 100000000; i++) {
myVariable = (i * 5) / 5;
}
return 1;
}
@topherPedersen
topherPedersen / edit_distance_based_string_similarity.js
Created Apr 15, 2020
Edit Distance Based String Similarity Algorithm Implementation in JavaScript
View edit_distance_based_string_similarity.js
var string = [];
string[0] = 'CALM 03/26 PURCHASE';
string[1] = 'CANVA* 02644-3020257 03/28 PURCHASE HTTPSCANVA.CO DE';
string[2] = 'VZWRLSS*PRPAY AUTOPAY 03/19 PURCHASE';
string[3] = 'WWW.NORDVPN.COM HTTPSWWW.NORD';
var findMe = 'CALM 02/26 PURCHASE INTERNET';
function calculateSimilarity(aString, bString) {
var matchingCharacters = 0;
@topherPedersen
topherPedersen / date_playground.py
Created Apr 7, 2020
Working with ISO 8601 Dates in Python Part II
View date_playground.py
from datetime import date, datetime
now = datetime.now()
print(now)
now_iso_8601 = now.isoformat()
print(now_iso_8601)
You can’t perform that action at this time.