Skip to content

Instantly share code, notes, and snippets.

Avatar
🚪

Tim Dorr timdorr

🚪
View GitHub Profile
View gist:5d1b67996e9daa0b0700f494aba61e48
P: GD492X-YMBP2J-MVRLR-847WC-V5NTY-J3HLY
S: 8LG52T-DYXG9W-QYYJL-AAC7B-GMFV5-2GZ6L
View worldometers.js
// ==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==
View adventure.py
# 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 Sep 18, 2020
Voice over header file from Supergiant's game Hades.
View VO.h
#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 / MainApplication.java
Created Feb 11, 2017
Tesla App is now React Native!
View MainApplication.java
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;
View ownerapi_endpoints.json
{
"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 Nov 29, 2017
React 16.2.0 with async rendering enabled.
View react-dom.async.js
/** @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 Nov 25, 2013
A basic self-referential friendship model in Rails 4.0.1
View IRB.rb
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 []>
View 1-all-in-one.js
class NotificationDropdown extends Component {
state = {};
async componentDidMount() {
const notifications = await fetchNotifications();
this.setState({ notifications });
}
render() {
const { notifications } = this.state;