Skip to content

Instantly share code, notes, and snippets.

View timdorr's full-sized avatar
🚪

Tim Dorr timdorr

🚪
View GitHub Profile
@timdorr
timdorr / MainApplication.java
Created February 11, 2017 14:36
Tesla App is now React Native!
package com.teslamotors.TeslaApp;
import android.app.Application;
import com.BaiduMaps.BaiduPackage;
import com.airbnb.android.react.maps.MapsPackage;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.i18n.reactnativei18n.ReactNativeI18n;
P: GD492X-YMBP2J-MVRLR-847WC-V5NTY-J3HLY
S: 8LG52T-DYXG9W-QYYJL-AAC7B-GMFV5-2GZ6L
// ==UserScript==
// @name Worldometers Tweaks
// @namespace http://tampermonkey.net/
// @version 1.0.1
// @description Add data to Worldometers
// @author timdorr
// @match https://www.worldometers.info/coronavirus/country/us/
// @icon https://www.google.com/s2/favicons?domain=worldometers.info
// @grant none
// ==/UserScript==
# For testsolvers using the Python version: please do not scroll further; you will get spoiled.
# (Instead, just run this Python script via `python adventure.py`)
@timdorr
timdorr / VO.h
Last active September 18, 2020 02:29
Voice over header file from Supergiant's game Hades.
#ifndef _VO_H
#define _VO_H
#define ACHILLES_0002 0
#define ACHILLES_0003 1
#define ACHILLES_0004 2
#define ACHILLES_0005 3
#define ACHILLES_0006 4
#define ACHILLES_0007 5
#define ACHILLES_0008 6
@timdorr
timdorr / ownerapi_endpoints.json
Created February 11, 2017 14:37
Tesla API Endpoints
{
"AUTHENTICATE": {
"TYPE": "POST",
"URI": "oauth/token",
"AUTH": false
},
"REVOKE_AUTH_TOKEN": {
"TYPE": "POST",
"URI": "oauth/revoke",
"AUTH": true
@timdorr
timdorr / react-dom.async.js
Created November 29, 2017 18:22
React 16.2.0 with async rendering enabled.
/** @license React v16.2.0
* react-dom.development.js
*
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
@timdorr
timdorr / IRB.rb
Created November 25, 2013 19:38
A basic self-referential friendship model in Rails 4.0.1
2.0.0p247 :002 > u = User.create!(name:"test")
(0.4ms) BEGIN
SQL (44.1ms) INSERT INTO "users" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 25 Nov 2013 19:35:06 UTC +00:00], ["name", "test"], ["updated_at", Mon, 25 Nov 2013 19:35:06 UTC +00:00]]
(0.8ms) COMMIT
=> #<User id: 1, name: "test", created_at: "2013-11-25 19:35:06", updated_at: "2013-11-25 19:35:06">
2.0.0p247 :003 > u.friends
User Load (2.2ms) SELECT "users".* FROM "users" INNER JOIN "friendships" ON "users"."id" = "friendships"."friend_id" WHERE "friendships"."user_id" = $1 [["user_id", 1]]
=> #<ActiveRecord::Associations::CollectionProxy []>
class NotificationDropdown extends Component {
state = {};
async componentDidMount() {
const notifications = await fetchNotifications();
this.setState({ notifications });
}
render() {
const { notifications } = this.state;