Skip to content

Instantly share code, notes, and snippets.

@oowekyala
oowekyala / JavaEscapeUtil.java
Created January 22, 2020 05:01
Escape routines for java text
class JavaEscapeUtil {
/**
* Replaces unprintable characters by their escaped (or unicode escaped)
* equivalents in the given string
*/
public static String escapeJava(String str) {
StringBuilder retval = new StringBuilder();
for (int i = 0; i < str.length(); i++) {
final char ch = str.charAt(i);
@KevinBatdorf
KevinBatdorf / add-alpine-js-to-tailwind-ui.js
Last active May 7, 2024 18:51
Auto copy the Alpine code from Tailwind UI's copy button
// ==UserScript==
// @name Add AlpineJs to Tailwind UI
// @namespace http://tampermonkey.net/
// @version 3.0
// @description Add Alpine JS code to Tailwind Ui copy/paste
// @author https://gist.github.com/KevinBatdorf/8bd5f808fff6a59e100dfa08a7431822
// @match https://tailwindui.com/components/*
// @grant none
// ==/UserScript==
@dannberg
dannberg / obsidian-daily-note-template.txt
Last active May 7, 2024 18:46
Dann Berg's Daily Note Template for Obsidian. Uses Dataview & Templater plugins. Should be saved as a Markdown file in Obsidian. Read the full tour: https://dannb.org/blog/2022/obsidian-daily-note-template/
---
created: <% tp.file.creation_date() %>
---
tags:: [[+Daily Notes]]
# <% moment(tp.file.title,'YYYY-MM-DD').format("dddd, MMMM DD, YYYY") %>
<< [[Timestamps/<% tp.date.now("YYYY", -1) %>/<% tp.date.now("MM-MMMM", -1) %>/<% tp.date.now("YYYY-MM-DD-dddd", -1) %>|Yesterday]] | [[Timestamps/<% tp.date.now("YYYY", 1) %>/<% tp.date.now("MM-MMMM", 1) %>/<% tp.date.now("YYYY-MM-DD-dddd", 1) %>|Tomorrow]] >>
---
// ==UserScript==
// @name TorrentLeech V5 Enhancer
// @namespace https://openuserjs.org/scripts/Sandbird/TorrentLeech_V5_Enhancer
// @description Enhance TorrentLeech
// @updateURL https://openuserjs.org/meta/Sandbird/TorrentLeech_V5_Enhancer.meta.js
// @include https://torrentleech.org/torrents/*
// @include https://www.torrentleech.org/torrents/*
// @include https://torrentleech.cc/torrents/*
// @include https://www.torrentleech.cc/torrents/*
// @resource trakt_btn https://rawgit.com/Sandbird/TL/master/tr.png
@cobyism
cobyism / gh-pages-deploy.md
Last active May 7, 2024 18:46
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@sts10
sts10 / rust-command-line-utilities.markdown
Last active May 7, 2024 18:45
A curated list of command-line utilities written in Rust

A curated list of command-line utilities written in Rust

Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.

Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.

The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.

  • atuin: "Magical shell history"
  • bandwhich: Terminal bandwidth utilization tool
@Hiroki-Kawakami
Hiroki-Kawakami / ContentView.swift
Last active May 7, 2024 18:38
SwiftUI Change Status Bar Color with UIWindow
//
// ContentView.swift
// StatusBarTest
//
// Created by hiroki on 2021/02/11.
//
import SwiftUI
struct ContentView: View {
@UnknownWitcher
UnknownWitcher / potato_patcher.pyw
Last active May 7, 2024 18:37 — forked from BluBb-mADe/potato_patcher.py
Generic Voicemeeter Potato in-memory patch
import os
import sys
import subprocess
import traceback
try:
from pymem import Pymem, process, exception
from win11toast import notify
import psutil
@radovankavicky
radovankavicky / LandGrid.js
Created December 13, 2016 08:41 — forked from rbrath/LandGrid.js
Equal Size Cartogram
var landGrid = [
{
"X": "1",
"Y": "1"
},
{
"X": "1",
"Y": "2"
},
{
@laobubu
laobubu / ABOUT.md
Last active May 7, 2024 18:37
A very simple HTTP server in C, for Unix, using fork()

Pico HTTP Server in C

This is a very simple HTTP server for Unix, using fork(). It's very easy to use

How to use

  1. include header httpd.h
  2. write your route method, handling requests.
  3. call serve_forever("12913") to start serving on port 12913