Skip to content

Instantly share code, notes, and snippets.

View halivert's full-sized avatar
🦏
Rushing like a rhino

Halí V. halivert

🦏
Rushing like a rhino
View GitHub Profile
@halivert
halivert / config
Created September 3, 2021 22:35
Git alias to use with jekyll
# -w Enable auto regeneration
# -o Open the site in the URL
# -l Live reload
# -H Hostname
# -P Port
serve = "!bundler exec jekyll serve -wol -H localhost -P 4000"
@halivert
halivert / yarn.ignore
Created September 24, 2021 19:48
Add gitignore when using yarn berry
.yarn/*
!.yarn/patches
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
.pnp.*
@halivert
halivert / AppServiceProvider.php
Created December 11, 2021 21:08
Set query grammar to support timestamps of n precision
<?php
namespace App\Providers;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\ServiceProvider;
use Illuminate\Database\Query\Grammars\MySqlGrammar;
class AppServiceProvider extends ServiceProvider
{
@halivert
halivert / useFetch.js
Last active April 20, 2022 17:16
My own useFetch composable/hook
const parseOptions = (options) => {
if (typeof options === "string") return parseOptions({ endpoint: options })
if (!Array.isArray(options)) {
return { endpoint: "", method: "GET", data: null, opts: {}, ...options }
}
if (options.length > 1) {
const [endpoint = "", method = "GET", data = null, opts = {}] = options
return { endpoint, method, data, opts }
@halivert
halivert / tsconfig.json
Last active April 28, 2022 11:07
Vite app with Typescript
{
"compilerOptions": {
"target": "esnext",
"useDefineForClassFields": true,
"module": "esnext",
"moduleResolution": "node",
"strict": true,
"jsx": "preserve",
"sourceMap": true,
"resolveJsonModule": true,
@halivert
halivert / count.py
Created September 28, 2022 13:42
Count participants of csv zoom meeting report in python
import csv
import sys
def readCSV(file_name):
with open(file_name, newline='') as csvfile:
reader = csv.reader(csvfile, delimiter=',', quotechar='|')
return [row[0] for row in reader]
@halivert
halivert / index.html
Created September 21, 2023 21:04
Split paragraph in lines
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et.</p>