Skip to content

Instantly share code, notes, and snippets.

Avatar
🎧
Heads down

tiff twhite96

🎧
Heads down
View GitHub Profile
@twhite96
twhite96 / starcounter.js
Created April 17, 2023 07:34 — forked from yyx990803/starcounter.js
Count your total stars!
View starcounter.js
var https = require('https'),
user = process.argv[2],
opts = parseOpts(process.argv.slice(3))
request('/users/' + user, function (res) {
if (!res.public_repos) {
console.log(res.message)
return
}
var pages = Math.ceil(res.public_repos / 100),
View gist:bf48656d51c908de12d8caeb5cdeb5f3
########################################
# Fix this, it leaks RAM like crazytown.
# Freed 6G of RAM immediately after
# removing this card! --spencer
########################################
id: crooked_status
type: custom:config-template-card
variables:
- states['sensor.disk_use_percent'].state
@twhite96
twhite96 / skew-highlight-on-text.css
Last active March 7, 2023 07:34
Skew highlights on text
View skew-highlight-on-text.css
h1 span {
position: relative;
z-index: 1;
}
h1 span::before {
content: "";
position: absolute;
top: 0;
bottom: 0;
left: -5px;
@twhite96
twhite96 / image-opt.yml
Last active February 4, 2023 23:35
Image opt workflow
View image-opt.yml
name: ci
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
name: calibreapp/image-actions
runs-on: ubuntu-latest
@twhite96
twhite96 / nested-object-destructuring.js
Created November 24, 2022 05:09
Nested object destructuring
View nested-object-destructuring.js
const cats = {
one: {
name: "Molly",
owner: "Fred Larkin",
color: "Brown",
age: 10,
kittens: 0
},
two: {
name: "Bob",
@twhite96
twhite96 / script.rb
Created September 14, 2022 22:31 — forked from seancdavis/script.rb
Move files up one directory in Ruby
View script.rb
require 'fileutils'
path = File.expand_path('../', __FILE__)
Dir.glob("#{path}/**/*.*").each do |file|
new_path = "#{path}/#{file.split('/')[-1]}"
FileUtils.mv(file, new_path)
end
@twhite96
twhite96 / 0.md
Created July 13, 2022 00:49 — forked from maxogden/0.md
JS hoisting by example
View 0.md

JavaScript function hoisting by example

Below are many examples of function hoisting behavior in JavaScript. Ones marked as works successfuly print 'hi!' without errors.

To play around with these examples (recommended) clone them with git and execute them with e.g. node a.js

Notes on hoisting

(I may be using incorrect terms below, please forgive me)

View keybase.md

Keybase proof

I hereby claim:

  • I am twhite96 on github.
  • I am tiffanyrwhite (https://keybase.io/tiffanyrwhite) on keybase.
  • I have a public key ASA5Nx3oT2IS58_RK9yLdqB4-J3oBf9149o1Ka1wBoihJgo

To claim this, I am signing this object:

@twhite96
twhite96 / session.server.ts
Created March 21, 2022 07:05 — forked from kentcdodds/session.server.ts
Authentication in Remix applications
View session.server.ts
import * as bcrypt from "bcrypt";
import { createCookieSessionStorage, redirect } from "remix";
import { db } from "./db.server";
export type LoginForm = {
username: string;
password: string;
};