Skip to content

Instantly share code, notes, and snippets.

View benbjurstrom's full-sized avatar

Ben Bjurstrom benbjurstrom

View GitHub Profile
@fawazahmed0
fawazahmed0 / cloudflare-tld-price-list.csv
Last active November 7, 2024 01:37
cloudflare domains price list for tlds
TLD Registration Fees Renewal Fees
example.org.uk 4.94 4.94
example.uk 4.94 4.94
example.me.uk 4.94 4.94
example.co.uk 4.94 4.94
example.date 4.16 5.16
example.trade 4.16 5.16
example.party 4.16 5.16
example.bid 4.16 5.16
example.stream 4.16 5.16
@innocenzi
innocenzi / inertia-layout.ts
Last active October 27, 2022 07:34
Laravel domain-driven front-end with Vite
import type { Plugin } from 'vite'
const PLUGIN_NAME = 'vite:inertia:layout'
const TEMPLATE_LAYOUT_REGEX = /<template +layout(?: *= *['"](?:(?:(\w+):)?(\w+))['"] *)?>/
export default (): Plugin => ({
name: PLUGIN_NAME,
transform: (code: string) => {
if (!TEMPLATE_LAYOUT_REGEX.test(code)) {
return
@dannberg
dannberg / obsidian-daily-note-template.txt
Last active November 15, 2024 15:28
Dann Berg's Daily Note Template for Obsidian. Uses Dataview & Templater plugins. Should be saved as a Markdown file in Obsidian. Read the full tour: https://dannb.org/blog/2022/obsidian-daily-note-template/
---
created: <% tp.file.creation_date() %>
---
tags:: [[+Daily Notes]]
# <% moment(tp.file.title,'YYYY-MM-DD').format("dddd, MMMM DD, YYYY") %>
<< [[Timestamps/<% tp.date.now("YYYY", -1) %>/<% tp.date.now("MM-MMMM", -1) %>/<% tp.date.now("YYYY-MM-DD-dddd", -1) %>|Yesterday]] | [[Timestamps/<% tp.date.now("YYYY", 1) %>/<% tp.date.now("MM-MMMM", 1) %>/<% tp.date.now("YYYY-MM-DD-dddd", 1) %>|Tomorrow]] >>
---
@katspaugh
katspaugh / README.md
Last active August 29, 2023 06:50
Draw text on Unicorn Hat with Raspberry Pi Pico

Drawing text on a Unicorn Hat

The Pimoroni Unicorn Hat comes with a handy MicroPython SDK. To use it, you need to download Pimoroni's fork of MicroPython that includes the Unicorn library, and upload it to Raspberry Pi Pico. Boot it with the button pressed and drag-n-drop the uf2 file to the disk that will appear on your computer. After that you can upload any Python script to that disk and it will run automatically if it's called main.py.

The Unicorn library has a function called picounicorn.set_pixel that lets you set the color of an individual LED. We take advantage of this function to draw characters using a 5x7 font. Each character is represented by 5 bytes, one per vertical row of pixels (or LEDS).

See https://github.com/Ameba8195/Arduino/blob/master/hardware_v2/cores/arduino/font5x7.h for details.

Temperature sensor

@kjmph
kjmph / A_UUID_v7_for_Postgres.sql
Last active November 16, 2024 17:02
Postgres PL/pgSQL function for UUID v7 and a bonus custom UUID v8 to support microsecond precision as well. Read more here: https://datatracker.ietf.org/doc/draft-peabody-dispatch-new-uuid-format/
-- Based off IETF draft, https://datatracker.ietf.org/doc/draft-peabody-dispatch-new-uuid-format/
create or replace function uuid_generate_v7()
returns uuid
as $$
begin
-- use random v4 uuid as starting point (which has the same variant we need)
-- then overlay timestamp
-- then set version 7 by flipping the 2 and 1 bit in the version 4 string
return encode(
@laravel-shift
laravel-shift / .php-cs-fixer.php
Last active November 10, 2024 11:16
PHP CS Fixer - Laravel Coding Style Ruleset
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
@sergomet
sergomet / GoogleDriveServiceProvider.php
Created April 1, 2017 07:01 — forked from ivanvermeyen/!NOTE.md
Setup a Laravel Storage driver with Google Drive API
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class GoogleDriveServiceProvider extends ServiceProvider
{
/**
* Bootstrap the application services.

The Laracasts PHPStorm theme - modified.

This is a slightly modified version of the great Laracasts PHPStorm theme. I've added some styles for Verions Control (add, modified, deleted line...) and fixed some missing things like warnings.

Download

image

Mac: Add to ~/Library/Preferences/WebIde80/colors

@ryane
ryane / five_minutes.yml
Created February 24, 2015 15:15
five_minutes.yml
---
- hosts: all
vars:
UBUNTU_COMMON_ROOT_PASSWORD: 'xxxxx'
UBUNTU_COMMON_DEPLOY_PASSWORD: 'xxxxx'
UBUNTU_COMMON_LOGWATCH_EMAIL: [email protected]
ubuntu_common_deploy_user_name: deploy
ubuntu_common_deploy_public_keys:
- ~/.ssh/id_rsa.pub
@denji
denji / README.md
Last active August 26, 2024 23:22 — forked from istepanov/gist:3950977
Remove/Backup – settings & cli for macOS (OS X) – DataGrip, AppCode, CLion, Gogland, IntelliJ, PhpStorm, PyCharm, Rider, RubyMine, WebStorm