Skip to content

Instantly share code, notes, and snippets.

View bonniss's full-sized avatar
🥐
Cancer - Croissant

Dan Teddy bonniss

🥐
Cancer - Croissant
View GitHub Profile
@bonniss
bonniss / better-sqlite3-cheatsheet.md
Last active March 31, 2024 19:58
better-sqlite3 cheatsheet

Refs:

// Init new db
// If the database file does not exist, it is created
// This happens synchronously, which means you can start executing queries right away
const Database = require('better-sqlite3');
@bonniss
bonniss / github-search-cheatsheet.md
Last active March 27, 2024 10:54
Github search cheatsheet from official docs.

Github Search Cheat Sheet

GitHub’s search supports a variety of different operations. Here’s a quick cheat sheet for some of the common searches.

For more information, visit our search help section.

Basic search

@bonniss
bonniss / sample-watercss.html
Created January 9, 2024 12:09
Beautiful sample HTML page - grab and replace your NGINX default site!
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/water.css@2/out/dark.css"
/>
<title>Beautiful Sample Page</title>
@bonniss
bonniss / memory_cache.js
Created February 5, 2023 16:23 — forked from mitio/memory_cache.js
Simple in-memory JavaScript object cache with a maxAge per key (in seconds) and maxEntries limit (per cache instance).
var MemoryCache = function (options) {
options = $.extend(true, {
maxEntries: null
}, options || {});
var self = this;
var cache = {};
var entries = 0;
var ageOf = function (entry) {
@bonniss
bonniss / my-psql-common.md
Last active August 13, 2022 21:19
PSQL Common Lines

Installation

Chocolatey

choco install postgresql13 --params '/Password:159753 /Port:5432'
psql -Upostgres
ALTER USER postgres WITH PASSWORD 'new_password';
@bonniss
bonniss / ansible-macos-homebrew-packages.yml
Created June 26, 2022 01:49 — forked from mrlesmithjr/ansible-macos-homebrew-packages.yml
Install MacOS Homebrew Packages With Ansible
---
- name: Install MacOS Packages
hosts: localhost
become: false
vars:
brew_cask_packages:
- atom
- docker
- dropbox
- firefox
@bonniss
bonniss / gl-param-datasource.json
Last active February 27, 2022 20:12
JSONPlaceholder.me
[
{
"labelKey": "label",
"valueKey": "value",
"data": [
{
"label": "Handmade",
"value": "car"
},
{
@bonniss
bonniss / project-create.sh
Created February 11, 2022 03:23 — forked from francoisromain/project-create.sh
A bash script to create a Git post-receive hook to deploy after a Git push
#!/bin/bash
# source: https://gist.github.com/francoisromain/58cabf43c2977e48ef0804848dee46c3
# and another script to delete the directories created by this script
# project-delete.sh: https://gist.github.com/francoisromain/e28069c18ebe8f3244f8e4bf2af6b2cb
# Call this file with `bash ./project-create.sh project-name`
# - project-name is mandatory
# This will creates 4 directories and a git `post-receive` hook.
if ("undefined" == typeof ZotataPlayUserID) var ZotataPlayUserID = "";
if ("undefined" == typeof ZotataPlayAuthKey) var ZotataPlayAuthKey = "";
if ("undefined" == typeof debug) var debug = -1 != location.hostname.indexOf("t.dragonbound.net");
var VERSION = 101,
SERVER_ADDRESS = -1 != location.hostname.indexOf("t.dragonbound.net") ? "http://t.dragonbound.net:9000" : "http://game.dragonbound.net:80",
LOCATION_TYPE_UNKNOWN = "unknown",
LOCATION_TYPE_CHANNEL = "channel",
LOCATION_TYPE_ROOM = "room",
ROOM_STATUS_WAITING = "W",
ROOM_STATUS_FULL = "F",
@bonniss
bonniss / dataset-1.json
Last active October 20, 2021 03:06
Dummy GA User Flows
{"filter":{"countries":{"id":"viet-nam","name":"Việt Nam"}},"meta":{"createAt":"2021-10-20T03:04:40.373Z"},"cols":[{"level":0,"nodes":[{"pageId":"page-khach-hang-than-thiet","id":"0-page-khach-hang-than-thiet"},{"pageId":"page-ho-tro-tien-ban","id":"0-page-ho-tro-tien-ban"},{"pageId":"page-chung-khoan-upcom","id":"0-page-chung-khoan-upcom"},{"pageId":"page-sao-ke-truc-tuyen","id":"0-page-sao-ke-truc-tuyen"},{"pageId":"page-others","id":"0-page-others"}]},{"level":1,"nodes":[{"pageId":"page-khach-hang-than-thiet","id":"1-page-khach-hang-than-thiet"},{"pageId":"page-trang-chu","id":"1-page-trang-chu"},{"pageId":"page-dat-lenh","id":"1-page-dat-lenh"},{"pageId":"page-chung-khoan-phai-sinh","id":"1-page-chung-khoan-phai-sinh"},{"pageId":"page-others","id":"1-page-others"}]},{"level":2,"nodes":[{"pageId":"page-mo-tai-khoan","id":"2-page-mo-tai-khoan"},{"pageId":"page-sao-ke-truc-tuyen","id":"2-page-sao-ke-truc-tuyen"},{"pageId":"page-dang-ky-quyen-mua","id":"2-page-dang-ky-quyen-mua"},{"pageId":"page-tai-lieu-huon