This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
export default class Canvas extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
canvasWidth: window.innerWidth, | |
canvasHeight: window.innerHeight, | |
mouseX: 0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from 'react'; | |
import Link from 'next/link'; | |
import MailchimpSubscribe from 'react-mailchimp-subscribe'; | |
import { CheckCircleIcon, InformationCircleIcon, XCircleIcon } from '@heroicons/react/solid'; | |
export default function EmailList(): JSX.Element { | |
// error currently not used | |
const [error, setError] = useState(null); | |
const [email, setEmail] = useState(''); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Dispatch, SetStateAction, useState, useEffect, useCallback, useRef } from 'react'; | |
export type StorageArea = 'sync' | 'local'; | |
// custom hook to set chrome local/sync storage | |
// should also set a listener on this specific key | |
type SetValue<T> = Dispatch<SetStateAction<T>>; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const OAuth = require('oauth') | |
const async = require('async') | |
const _ = require('lodash') | |
// YOU CAN FIND THIS ON YOUR TWITTER DEVELOPER CONSOLE | |
const CLIENT_ID = 'YOUR TWITTER CONSUMER KEY' | |
const CLIENT_SECRET = 'YOUR TWITTER CONSUMER SECRET' | |
const ACCESS_TOKEN = 'YOUR ACCESS TOKEN' | |
const ACCESS_SECRET = 'YOUR ACCESS SECRET' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Jitai | |
// @version 1.3.2 | |
// @description Display WaniKani reviews in randomized fonts, for more varied reading training. | |
// @author Samuel (@obskyr) | |
// @copyright 2016-2018, obskyr | |
// @license MIT | |
// @namespace http://obskyr.io/ | |
// @homepageURL https://gist.github.com/obskyr/9f3c77cf6bf663792c6e | |
// @icon http://i.imgur.com/qyuR9bD.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
drop function increment_views; | |
create function increment_views(post_slug text) | |
returns setof public.posts as | |
$$ | |
update public.posts | |
set views = views + 1 | |
where slug = post_slug; | |
select * from public.posts where slug = post_slug; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Copy everything for the respective card side in between the START and END comments --> | |
<!-- Front of card START --> | |
<div style="font-size: 18px;">{{hint:Vocabulary-Kana}}</div> | |
<div style="font-size: 50px;">{{Vocabulary-Kanji}}</div> | |
<div style="font-size: 25px;">{{hint:Expression}}</div> | |
<!-- Front of card end END --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rename Images with Date Photo Taken | |
# Purpose: Renames image files in a folder based on date photo taken from EXIF metadata | |
# Original Author: Matthew Renze | |
# Usage: python.exe rename.py input-folder | |
# - input-folder = (optional) the directory containing the image files to be renamed | |
# Examples: python rename.py /path/to/photos |