Skip to content

Instantly share code, notes, and snippets.

@arlomba
arlomba / tailwind.js
Created January 30, 2019 23:07
Tailwind CSS config using Material Design colors
/*
Tailwind - The Utility-First CSS Framework
A project by Adam Wathan (@adamwathan), Jonathan Reinink (@reinink),
David Hemphill (@davidhemphill) and Steve Schoger (@steveschoger).
Welcome to the Tailwind config file. This is where you can customize
Tailwind specifically for your project. Don't be intimidated by the
length of this file. It's really just a big JavaScript object and
@lacymorrow
lacymorrow / docReady.js
Created January 28, 2019 19:46
A plain, vanilla, cross-browser JS document.ready function
/* Credit to https://github.com/jfriend00/docReady
*
* Call with docReady(fn, context)
*/
(function(funcName, baseObj) {
"use strict";
// The public function name defaults to window.docReady
// but you can modify the last line of this function to pass in a different object or method name
// if you want to put them in a different namespace and those will be used instead of
// window.docReady(...)
@hamzahamidi
hamzahamidi / open-cmder-here.md
Last active June 29, 2025 19:06
"Open Cmder Here" in context menu

"Open Cmder Here" in context menu

Edit 04/2021:

As of the lastest versions, just execute the following command .\cmder.exe /REGISTER ALL per Documentation.

Original Solution

To add an entry in the Windows Explorer context menu to open Cmder in a specific directory, paste this into a OpenCmderHere.reg file and double-click to install it.

@gautham20
gautham20 / pypika_custom_fn.py
Created December 7, 2018 13:08
adding custom functions to query in pypika
from pypika import Table, Query
from pypika.terms import Function
class ToUnixtime(Function):
def __init__(self, input):
super(ToUnixtime, self).__init__('to_unixtime', input)
actions = Table('test.actions')
@disintegrator
disintegrator / https-during-dev.macos.sh
Last active October 23, 2024 08:32
Use Caddy, mkcert and dnsmasq to expose your development server over HTTPS
brew install caddy mkcert nss dnsmasq
mkcert -install
mkcert '*.app.test' '*.cdn.test'
# rename the certs and move them under /usr/local/etc/caddy/certs
cat <<EOF > /usr/local/etc/caddy/Caddyfile
*.app.test:443, *.cdn.test:443 {
@FMCorz
FMCorz / sandbox.py
Last active October 2, 2023 12:25
Django standalone script #python #django
# Standalone Django script
#
# Ideal for quickly testing some code.
#
# 1. Place at the root of your project
# 2. Edit the variable PROJECT_NAME
# 3. Run it: python sandbox.py
import os
@bebosudo
bebosudo / django_custom_widget.md
Last active January 25, 2024 02:48
Custom django form widget with no pain.

First of all, edit your_app_settings/settings.py and add:

INSTALLED_APPS = [
    'django.forms',  # to let django discover the built-in widgets
    ...
]

FORM_RENDERER = 'django.forms.renderers.TemplatesSetting'
import hmac
import hashlib
import base64
class ImgProxy:
"""
The class generates a signature for the imgproxy (https://github.com/DarthSim/imgproxy).
Author: Yehor Smoliakov (https://github.com/egorsmkv)
@sloanlance
sloanlance / jq_jsonl_conversion.md
Last active June 23, 2025 02:11
jq: JSONL ↔︎ JSON conversion

jq: JSONL ↔︎ JSON conversion

Prerequisites

  • jqhttps://jqlang.org/ — "like sed for JSON data"

    There are several options available for installing jq. I prefer to use Homebrew: brew install jq

  • JSONL → JSON

@justsml
justsml / fetch-api-examples.md
Last active April 22, 2025 13:44
JavaScript Fetch API Examples