Skip to content

Instantly share code, notes, and snippets.

@kimadactyl
kimadactyl / README.sh
Last active May 10, 2024 14:23
Dokku / Digital Ocean / Rails / Postgres / Let's Encrypt / persistent storage
# Creating a Digital Ocean droplet running Rails + Postgres with persistant storage and https
#--------------------------------------------------------------------------------------------
# For your ctrl-D pleasure...
# SERVER_IP
# APP_NAME
# RAILS_SECRET (generate with `rails secret`)
# ADMIN_EMAIL
@ginmaster
ginmaster / init.sh
Last active May 10, 2024 14:23
Setup vaultwarden + fail2ban + caddy2 + Yubikey on Ubuntu (Amd64) on digitalocean with docker-compose
#!/bin/bash
printf "
####################################################################
# Tested with following setup: #
# Ubuntu 20.04 (LTS) x64 droplet on digitalocean with a cloudflare #
# managed domain pointing to the droplet's external IP. Please #
# follow the steps commented in init.sh: #
####################################################################\n"
# ssh root@1.2.3.4 (IP of droplet)
# wget https://gist.github.com/ginmaster/c6d11697c4fa67442889f379380ba6c0/raw/d58f803e731eadf3d2bb0951ff1c0e6d7d18ef69/init.sh
@tangentstorm
tangentstorm / ed.ijs
Last active May 10, 2024 14:22
A tiny editor in J
NB. Core logic for a tiny editor in J.
NB. No select/copy/paste (in this gist), but it does support multiple cursors.
NB. This started as the code for editing a single line of text, but I'm now
NB. using three copies simultaneously: one for a single token, one for
NB. boxed tokens on a line, and one for boxed lines in a buffer.
coclass 'ed'
init =: {{
B =: '' NB. the buffer to edit.
C =: 0 NB. cursor position(s)
@jrgcubano
jrgcubano / CreateDateDimensionWithFiscals.sql
Created November 25, 2019 09:08 — forked from cgibson-dev/CreateDateDimensionWithFiscals.sql
A SQL script to create a Date dimension table with logic to specify fiscal dates.
BEGIN TRY
DROP TABLE [Dim].[Date]
END TRY
BEGIN CATCH
/*No Action*/
END CATCH
CREATE TABLE [Dim].[Date]
(
@aparrish
aparrish / understanding-word-vectors.ipynb
Last active May 10, 2024 14:19
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@apsun
apsun / build.gradle.kts
Last active May 10, 2024 14:17
Documented build.gradle for publishing an Android library to Maven Central
// This is a documented version of the build.gradle file from RemotePreferences:
// https://github.com/apsun/RemotePreferences/blob/master/library/build.gradle.kts
//
// It aims to explain exactly WTF is going on when you inevitably copy-paste
// someone's build.gradle from the internet and can't figure out why it's not
// working.
//
// It contains, to the best of my knowledge, the best practices as of Oct 2023 for
// building an Android library and publishing it to OSSRH (Maven Central).
//
@edokeh
edokeh / index.js
Last active May 10, 2024 14:15
佛祖保佑,永无 BUG
//
// _oo0oo_
// o8888888o
// 88" . "88
// (| -_- |)
// 0\ = /0
// ___/`---'\___
// .' \\| |// '.
// / \\||| : |||// \
// / _||||| -:- |||||- \
@rxaviers
rxaviers / gist:7360908
Last active May 10, 2024 14:14
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@ibrahimhajjaj
ibrahimhajjaj / open_folder_in_PhpStorm_2020.bat
Last active May 10, 2024 14:15
Add Open Folder in PHPStorm to Windows Context Menu
@echo off
SET PhpStormPath=C:\Program Files\JetBrains\PhpStorm 2020.3.3\bin\phpstorm64.exe
echo Adding file entries
@reg add "HKEY_CLASSES_ROOT\*\shell\PhpStorm" /t REG_SZ /v "" /d "Open in PhpStorm" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\PhpStorm" /t REG_EXPAND_SZ /v "Icon" /d "%PhpStormPath%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\PhpStorm\command" /t REG_SZ /v "" /d "%PhpStormPath% \"%%1\"" /f
echo Adding within a folder entries
/*
* Copyright (c) 1987, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright