Skip to content

Instantly share code, notes, and snippets.

@oofnikj
oofnikj / answerfile
Last active May 14, 2024 11:27
Install Docker on Termux
KEYMAPOPTS="us us"
HOSTNAMEOPTS="-n alpine"
INTERFACESOPTS="auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
hostname alpine
"
TIMEZONEOPTS="-z UTC"
@mickdekkers
mickdekkers / SnapshotCamera.cs
Last active May 14, 2024 11:26
Take snapshot images of Prefabs and GameObjects in Unity using Render Textures
using UnityEditor;
using UnityEngine;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text.RegularExpressions;
// Object rendering code based on Dave Carlile's "Create a GameObject Image Using Render Textures" post
// Link: http://crappycoding.com/2014/12/create-gameobject-image-using-render-textures/
@plembo
plembo / firefox-bookmarks-backup-html.md
Last active May 14, 2024 11:24
Bookmarks backup to HTML for Firefox

Automatically backing up Firefox bookmarks to HTML

By default, Firefox automatically backs up your current bookmarks to a .json file under the current user profile, usually a path like ".mozilla/firefox/xxxx.default/bookmarkbackups". Some of us still like to work with the old-school HTML export instead.

To enable automatic backups of bookmarks to HTML, you need to add the following through either "about:config" or in the optional user.js config file (where customizations to prefs.js can be added). The backup will be created and then overwritten every time the browser is closed.

If doing this through about:config, search for browser.bookmarks.autoExportHTML (if it doesn't exist, create it as a boolean item), and set to true. Then create the browser.bookmarks.file item as a string item and enter the full path for the file (e.g., /home/myuser/bookmarks.html, where "myuser" is your login name on the system).

Before making the change in user.js (located at ~/.mozilla/firefox/xxx.default, if it doesn't exist c

//
// ContentView.swift
// AppleMusicLyricsPlayer
//
// Created by Magesh Sridhar on 2/5/23.
//
import SwiftUI
import AVKit
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active May 14, 2024 11:24
set -e, -u, -o, -x pipefail explanation
@ahemwe
ahemwe / calendar.php
Created May 28, 2014 19:36
php caldav to ical converter for mailbox.org
<?php
$userpwd = '<user>:<pwd>';
$baseurl = 'https://dav.mailbox.org/';
header('Content-type: text/calendar; charset=utf-8');
header('Content-Disposition: attachment; filename=Kalender.ics');
// new cURL-Handle
$ch = curl_init();
@HarmJ0y
HarmJ0y / PowerView-3.0-tricks.ps1
Last active May 14, 2024 11:20
PowerView-3.0 tips and tricks
# PowerView's last major overhaul is detailed here: http://www.harmj0y.net/blog/powershell/make-powerview-great-again/
# tricks for the 'old' PowerView are at https://gist.github.com/HarmJ0y/3328d954607d71362e3c
# the most up-to-date version of PowerView will always be in the dev branch of PowerSploit:
# https://github.com/PowerShellMafia/PowerSploit/blob/dev/Recon/PowerView.ps1
# New function naming schema:
# Verbs:
# Get : retrieve full raw data sets
# Find : ‘find’ specific data entries in a data set
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active May 14, 2024 11:20
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@nchevobbe
nchevobbe / screenshot.js
Last active May 14, 2024 11:17
Log a data URL containing a screenshot of the window
let canvas = window.document.createElementNS("http://www.w3.org/1999/xhtml", "html:canvas");
let context = canvas.getContext("2d");
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
context.drawWindow(window, 0, 0, canvas.width, canvas.height, "white");
console.log(`
📸 📸 📸 📸
${canvas.toDataURL()}