Skip to content

Instantly share code, notes, and snippets.

View byjpr's full-sized avatar

Jordan P.R. byjpr

  • Shires, UK
View GitHub Profile
@tomjohnneill
tomjohnneill / calculate.js
Created January 5, 2022 01:38
Calculate the best possible guess for Wordle
import { list } from "./wordlist.json";
const matchesFilters = (wordList, filters) => {
return wordList.filter((word) => {
let match = true;
for (let i = 0; i < filters.length; i += 1) {
const { colour, position, letter } = filters[i];
if (colour === "black") {
if (word.includes(letter)) {
match = false;
@electron0zero
electron0zero / README.md
Last active June 16, 2021 17:33
Deploy sentry-kubernetes in multiple Kubernetes (gke) clusters
@revooms
revooms / brands.user.css
Last active March 14, 2024 19:03
Collection of my personal userstyles and userscripts
/* ==UserStyle==
@name brands.css - Color links to prominent sites
@description Highlight links to prominent sites with the sites main color
@namespace github.com/revooms
@version 0.9.2
@author revooms
@homepageURL https://gist.github.com/revooms/61a1d536ff6f1b9916a9f865f69e38cc#file-brands-user-css
@updateURL https://gist.github.com/revooms/61a1d536ff6f1b9916a9f865f69e38cc/raw/brands.user.css
==/UserStyle== */
@-moz-document url-prefix(http), url-prefix(https) {
/*
JSON-to-Go
by Matt Holt
https://github.com/mholt/json-to-go
A simple utility to translate JSON into a Go type definition.
*/
function jsonToGo(json, typename) {
let data;
let scope;
defmodule Core.Webhook.Dispatcher do
use GenServer
alias Webhook.{Event, Events}
require Logger
@config Application.get_env(:core, __MODULE__)
@max_concurrency @config[:concurrency]
@jitter 100
@abhin4v
abhin4v / cache_server.exs
Created March 18, 2018 06:36
Simple cache using GenServer in Elixir
defmodule CacheServer do
use GenServer
@name CS
## Client API
def start_link(opts \\ []) do
GenServer.start_link(__MODULE__, :ok, opts ++ [name: CS])
end
@bmatthewshea
bmatthewshea / whattomine-hashtimes.py
Last active January 11, 2024 05:55
Python script to calculate time to win full block and revenue per day. (GPU MINING)
#!/usr/bin/python
# -*- coding: utf-8 -*-
# "Whattomine GPU Hash time calculator"
#
# This is not for CPU or ASIC calculations.
# Author: Brady Shea
# Email: Use github user: bmatthewshea or gist comments
# Origin: https://gist.github.com/bmatthewshea/90b120722e0561dd235adcdc231b6765
#
@ridem
ridem / 1_shopify_system_translations.md
Last active March 7, 2022 14:22
Shopify Checkout & system translations - Chinese

How to get Shopify system's translation keys

Go to https://{{your_shopify_domain}}/admin/themes/{{your_theme_code}}/language?category=checkout+%26+system

To get Shopify's system translation keys

Open your browser console and paste this code:

var obj = {};
$(".translation__target").each(function() {
  var value = this.children[0].value ? this.children[0].value : this.children[0].placeholder
@jeremyjaymes
jeremyjaymes / hugo_seo.html
Last active March 21, 2021 08:39
Hugo SEO Markup
<meta name="description" content="{{ if .IsHome }}{{ .Site.Params.description }}{{ else }}{{ .Description }}{{ end }}"/>
<meta name="robots" content="noodp"/>
<link rel="canonical" href="{{ .Permalink }}" />
<!-- Twitter Card -->
<meta name="twitter:card" content="summary" />
<meta name="twitter:description" content="{{ if .IsHome }}{{ .Site.Params.description }}{{ else }}{{ .Description }}{{ end }}" />
<meta name="twitter:title" content="{{ .Title }}{{ if .IsHome }} - {{ .Site.Params.Tagline }}{{ else }} - {{ .Site.Title }}{{ end }}" />
<meta name="twitter:site" content="{{ .Site.Params.twitter }}" />
<meta name="twitter:creator" content="{{ .Site.Params.twitter }}" />
# to run: docker-compose run
#
# Create a .evn file in the same folder as this file and change the variables.
# MOUNT_POINT=/tmp/
# VPN_PROVIDER=changeme
# VPN_CONFIG=changeme
# VPN_USERNAME=changeme
# VPN_PASSWORD=changeme
#
#