Skip to content

Instantly share code, notes, and snippets.

View martinvd's full-sized avatar

Martin van Driel martinvd

View GitHub Profile
@bdsqqq
bdsqqq / vesper-dark.json
Last active May 16, 2024 00:57
Vesper theme for zed.dev
{
"$schema": "https://zed.dev/schema/themes/v0.1.0.json",
"name": "Vesper",
"author": "Rauno Freiberg",
"themes": [
{
"name": "Vesper",
"appearance": "dark",
"style": {
"border": "#101010",
@levelsio
levelsio / upgradeSubPrice.php
Created October 8, 2023 17:28
This script upgrades the price on active subscriptions on Stripe
<?
// set price
$newPricePlanId='price_1NsRt5Inbsdfsfddsf';
$newPriceMonthly=39;
$i=1;
foreach($users as $user) {
if(!$user['stripe_customer_id']) {
echo "No Stripe customer id, maybe update in db?";
#!/usr/bin/env bash
set -Eeuo pipefail
hosts_file="/etc/hosts"
hosts=(
"www.reddit.com"
"twitter.com"
"www.nrc.nl"
"www.theguardian.com"
@erikyuzwa
erikyuzwa / wordpress-6-2-2-docker-compose.yml
Last active May 17, 2024 12:17
Wordpress 6.2.2 Docker Compose for Local Development
# create a local .env file with the following 4 properties:
#
# MYSQL_DATABASE=<something>
# MYSQL_USER=<something>
# MYSQL_PASSWORD=<something>
# MYSQL_ROOT_PASSWORD=<something>
#
# Note: I have had a LOT of issues working with anything newer then Docker Desktop v4.26.1
# If you're on something newer, then double check against this release.
#
<?
//
// AUTO KEYWORD-BASED FOLLOWER CURATION BOT (by @levelsio)
//
// File: twitterFollowerCuratorBot.php
//
// Created: May 2021
// License: MIT
//
@sindresorhus
sindresorhus / esm-package.md
Last active May 22, 2024 07:35
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
/**
* A bookmarklet for viewing the largest contentful paint in a page.
* Will show each LCP after the bookmarklet is clicked.
*
* To install:
* 1. Copy the code starting from the line beginning `javascript:`
* 2. Add a new bookmark in Chrome, and paste the code in as the URL.
**/
javascript:(function(){
try {
@poliquin
poliquin / mariadb-docker-digitalocean.md
Last active April 28, 2024 11:28
Using MariaDB via Docker on Digital Ocean

Notes on MariaDB and Docker

These notes describe how to start a MariaDB container with Docker on a Digital Ocean droplet running Ubuntu.

Installing Docker

Follow the instructions for [Docker CE on Ubuntu][0]:

How we incorporate next and cloudfront (2018-04-21)

Feel free to contact me at robert.balicki@gmail.com or tweet at me @statisticsftw

This is a rough outline of how we utilize next.js and S3/Cloudfront. Hope it helps!

It assumes some knowledge of AWS.

Goals

@dmitrizzle
dmitrizzle / Dots.js
Created January 11, 2018 14:59
A components for displaying "loading" dots with CSS (for ReactJS and Styled Components)
// tools
import React from "react"
import styled from "styled-components"
// styles
const Dots = styled.span`
&::after {
display: inline-block;
animation: ellipsis 1.25s infinite;
content: ".";