Skip to content

Instantly share code, notes, and snippets.

View justinnoel's full-sized avatar

Justin Noel justinnoel

View GitHub Profile
@madmax
madmax / gist:1474059
Created December 13, 2011 21:54
changing font in textmate 2
1. Open Bundle editor
2. Select Themes -> Themes -> your theme
3. add to settings
fontName = 'Monaco';
fontSize = '12px';
or what you want, enjoy :)
@elfrank
elfrank / collaborate_on_branches.md
Last active August 19, 2024 12:58
How to work on someone else's branch

#How to work on someone else's branch

Let's assume you need to collaborate with Batman on his forked repository.

  • First, you need to add his fork as a remote.
git remote add batman [email protected]:batman/iambatman.git
  • Now, you can fetch, pull and push to his fork (if you have permissions to do so).
@shrop
shrop / curl-loop.sh
Created March 31, 2017 14:12
Script to loop through a text file list of URLs and output the curl -I to a text file
#!/bin/bash
for i in $(cat urls.txt); do
content=$(curl -I -s "{$i}")
echo "URL: $i" >> output.txt
echo "$content" >> output.txt
done
@sarah11918
sarah11918 / Astro21Diff.md
Created November 21, 2021 17:35
Astro v0.21.0 - differences that aren't bugs/breaking changes

What's DIFFERENT (but not necessarily buggy/breaking) in Astro 0.21.0 ???

1. How to include a layout in .md files

Previously, front matter REQUIRED a layout property (e.g. layout: ../../layouts/MarkdownPostLayout.astro) Now, it's ALSO OK to include your layout as an import in "setup":

setup: |
  import Layout from '../../layouts/BlogPost.astro'
  import SomeOtherComponent from '../../components/SomeOtherComponent.astro'
@cryptoskillz
cryptoskillz / gist:98b8e7090b7cc8d51531bb9dcfe7654a
Created December 5, 2021 16:48
Tips on how to use a KV namespace with Cloudflare Pages
This gist aims to show you how to use KV datastore using Cloudflare pages. The reason I created this quick guide is it took
me almost 2 weeks to get it working, mainly because it is very new and the documentation is not up fully fleshed out yet
https://developers.cloudflare.com/workers/runtime-apis/kv
https://developers.cloudflare.com/pages/platform/functions
https://blog.cloudflare.com/wrangler-v2-beta/
Steps:
Install wrangler 2
@Princesseuh
Princesseuh / Image.astro
Last active January 30, 2022 04:13
Astro + eleventy-img
---
import Image from "@11ty/eleventy-img"
import { generateImage } from "utils.ts"
import { Markdown } from "astro/components"
const {
src,
alt,
caption,
options = {},
sizes = "",
@mosch
mosch / repository.ts
Created April 3, 2022 08:35
Cloudflare Typed Repository with Prefixa
class RepositoryNamespace<Entity = string, Metadata = {}> {
private readonly ns: string
private readonly kv: KVNamespace
constructor(kv: KVNamespace, namespace: string) {
this.ns = namespace
this.kv = kv
}
put(key: string, entity: Entity) {
#!/bin/bash
# Check if the RUN_TYPECHECKER_PRECOMMIT_HOOK environment variable is set to "true"
if [ "$RUN_TYPECHECKER_PRECOMMIT_HOOK" = "true" ]; then
echo "Running TypeScript type checker..."
# Run the TypeScript compiler in type-checking mode and capture the output
tsc_output=$(npx tsc --noEmit 2>&1)
tsc_exit_code=$?
@johnspurlock-skymethod
johnspurlock-skymethod / export-d1-database-to-sqlite.md
Created September 11, 2024 16:44
Export a D1 database to a local sqlite3 db file

New one-liner command to download a Cloudflare D1 database to a local sqlite db file.

Prerequisites:

Install the latest Denoflare CLI (newest commit, not release-tagged yet) if not already installed

  • Install deno if not already installed
  • Then install Denoflare: deno install -A --name denoflare --force https://raw.githubusercontent.com/skymethod/denoflare/66b741c9242e724adbf030a2be26af4b58432631/cli/cli.ts

Run the new denoflare d1 export-db command