Skip to content

Instantly share code, notes, and snippets.

View johncalvinroberts's full-sized avatar
🧚‍♀️

John Roberts johncalvinroberts

🧚‍♀️
View GitHub Profile
@johncalvinroberts
johncalvinroberts / quine.go
Last active September 25, 2022 17:22
An example of a quine in the go programming language
package main
import (
_ "embed"
)
//go:embed main.go
var code string
func main() {
@johncalvinroberts
johncalvinroberts / 001.aqi.1h.go
Last active January 15, 2022 02:52
XBar plugin to show the current AQI every hour
// <xbar.title>AQI</xbar.title>
// <xbar.version>v1.0</xbar.version>
// <xbar.author>John Roberts</xbar.author>
// <xbar.author.github>johncalvinroberts</xbar.author.github>
// <xbar.desc>The script displays AQI in location</xbar.desc>
// <xbar.image>https://raw.githubusercontent.com/christophschlosser/bitbar-plugins/checkhosts/Network/checkhosts.png</xbar.image>
// <xbar.dependencies>go</xbar.dependencies>
package main
@johncalvinroberts
johncalvinroberts / 001.locations.1m.go
Last active November 1, 2021 05:27
XBar plugin to show local time in various timezones and difference with local time
// <xbar.title>Locations</xbar.title>
// <xbar.version>v1.0</xbar.version>
// <xbar.author>John Roberts</xbar.author>
// <xbar.author.github>johncalvinroberts</xbar.author.github>
// <xbar.desc>The script displays the time in different timezones</xbar.desc>
// <xbar.image>https://raw.githubusercontent.com/christophschlosser/bitbar-plugins/checkhosts/Network/checkhosts.png</xbar.image>
// <xbar.dependencies>go</xbar.dependencies>
package main
const fs = require("fs");
const { promisify } = require("util");
const pp = require("papaparse");
const readFile = promisify(fs.readFile);
const writeFile = promisify(fs.writeFile);
const mutateMemoForPerson = (memo, person, pricePerPerson, title) => {
const maybeCouple = person.split("*");
if (maybeCouple.length > 1) {
@johncalvinroberts
johncalvinroberts / .eslintrc
Created March 10, 2019 03:12
⚛️ super strict react eslint config
{
"extends": [
"airbnb",
"prettier",
"prettier/react"
],
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 2017,
"ecmaFeatures": {
@johncalvinroberts
johncalvinroberts / chinese-font-fallback.css
Created February 27, 2019 04:04
Chinese system font fallback CSS stack
html {
font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,PingFang SC,Microsoft YaHei,微软雅黑,Source Han Sans SC,Noto Sans CJK SC,WenQuanYi Micro Hei,STXihei,华文细黑,sans-serif;
}
@johncalvinroberts
johncalvinroberts / gitgraph.sh
Last active February 27, 2019 04:06
🌈Git Graph -- git alias to show commit history in a pretty graph tree thing
git config --global alias.graph "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
class Drug
def initialize
@substance = []
@bulk_price = 0
@street_price = 0
@power = 0
end
attr_reader :power
attr_accessor :bulk_price, :substance, :street_price
end