Skip to content

Instantly share code, notes, and snippets.

View rickdaalhuizen90's full-sized avatar

Rick Daalhuizen rickdaalhuizen90

  • Belgium
View GitHub Profile
@rickdaalhuizen90
rickdaalhuizen90 / .env.example
Created December 27, 2023 20:04
Generate a commit message using the OpenAI GPT-3 API
OPENAI_API_KEY="<YOUR_SECRET_KEY>"
OPENAI_ENDPOINT="https://api.openai.com/v1/chat/completions"
@rickdaalhuizen90
rickdaalhuizen90 / App.svelte
Last active December 30, 2021 22:00
Calendar heatmap
<section>
<h3>Uptime</h3>
<p>Overview of site uptime</p>
<div id="heatmap"></div>
</section>
<script>
import {onMount} from 'svelte';
import matrix from 'calendar-matrix';
@rickdaalhuizen90
rickdaalhuizen90 / .zshrc
Created July 13, 2020 18:03
Enhance your terminal with zsh and Prezto
#
# Executes commands at the start of an interactive session.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
# Source Prezto.
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
@rickdaalhuizen90
rickdaalhuizen90 / gulp.js
Created April 12, 2020 11:31
Responsive images
const gulp = require('gulp');
const responsive = require('gulp-responsive');
gulp.task('build:responsive', () => {
return gulp
.src(['static/media/*.{gif,jpg,jpeg,png}'])
.pipe(responsive({
'**/*': [{
width: 2240,
height: 320,
@rickdaalhuizen90
rickdaalhuizen90 / client.php
Last active September 26, 2023 17:17
PHP OAuth client for Magento 2 REST API
<?php
/*
* OAuth 1.0a client (Example) for Magento 2
*
* @see: https://oauth.net/core/1.0a
* @see: https://tools.ietf.org/html/rfc5849
*/
class Api
{
const OAUTH_VERSION = '1.0';
@rickdaalhuizen90
rickdaalhuizen90 / script.php
Last active June 15, 2024 17:00
PHP script that removes duplicate fields in a csv
<?php
if ($argc < 2) {
exit('Error: No CSV file provided. Example usage: php script.php input.csv' . PHP_EOL);
}
if (pathinfo($argv[1], PATHINFO_EXTENSION) !== 'csv') {
exit('Error: Provided file is not a CSV.' . PHP_EOL);
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
body {
font-family: sans-serif;
font-size: 1.3em;
<!DOCTYPE html>
<html>
<head>
<title>Welcome to Vue</title>
<script src="https://unpkg.com/vue"></script>
<style id="jsbin-css">
.dashboard {
display: flex;
flex-direction: row;
width: 100%;
#!/bin/sh
echo "Deleting old publication"
rm -rf public
mkdir public
git worktree prune
rm -rf .git/worktrees/public/
echo "Checking out gh-pages branch into public"
git worktree add -B gh-pages public origin/gh-pages
:root {
--tab-curve-width: 30px;
--tabs-border: transparent !important;
}
*.textbox-input::-moz-placeholder { color:transparent !important; }
.tabbrowser-arrowscrollbox .arrowscrollbox-scrollbox {
padding-inline-start: 10px !important;
}