Skip to content

Instantly share code, notes, and snippets.

@MattDahEpic
MattDahEpic / hacknet_osboot.txt
Created April 2, 2017 05:21
The Hacknet fake bootup sequence text
PMAP: PCID enabled
Hacknet Kernel Version 1.0.0: Tue Oct 11 20:56:35 PDT 2011; root:xnu-1699.22.73~1/RELEASE_X86_64
vm_page_bootstrap: 987323 free pages and 53061 wired pages
kext submap [0xffffff7f8072e000 - 0xffffff8000000000], kernel text [0xffffff8000200000 - 0xffffff800072e000]
zone leak detection enabled
standard timeslicing quantum is 10000 us
mig_table_max_displ = 72
TSC Deadline Timer supported and enabled
HacknetACPICPU: ProcessorId=1 LocalApicId=0 Enabled
HacknetACPICPU: ProcessorId=2 LocalApicId=2 Enabled
@logickoder
logickoder / ComposePdfExporter.kt
Created January 1, 2025 16:22
Export a scrollable composable to PDF
package dev.logickoder.printer
import android.app.Dialog
import android.content.Context
import android.graphics.Bitmap
import android.graphics.Canvas
import android.graphics.Rect
import android.graphics.pdf.PdfDocument
import android.view.View
import androidx.compose.foundation.gestures.scrollBy
@matthewzring
matthewzring / markdown-text-101.md
Last active January 2, 2025 05:26
A guide to Markdown on Discord.

Markdown Text 101

Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to do it! Just add a few characters before & after your desired text to change your text! I'll show you some examples...

What this guide covers:

@callemo
callemo / wg.sh
Last active January 2, 2025 05:25
WireGuard for OpenBSD
#!/bin/sh
gw="$(route -n show | awk '$1 == "default" { print $2 }')"
awk -v gw="$gw" '
$1 == "PrivateKey" { key = $3 }
$1 == "Address" {
addr = $3
sub(/,.*/, "", addr)
}
$1 == "DNS" { dns = $3 }
$1 == "PublicKey" { peer = $3 }
@idleberg
idleberg / fish_shell.md
Last active January 2, 2025 05:22
Instructions on how to install Fish shell on Mac OS X, including Oh My Fish!. Also includes several useful functions.

Installation

  1. Install fish via Brew
  2. Optionally install Oh My Fish!
  3. Add fish to known shells
  4. Set default shell to fish
brew install fish  
curl -L https://get.oh-my.fish | fish
# Nhớ cài "pip install transformers gradio Pillow"
from PIL import Image
from transformers import BlipProcessor, BlipForConditionalGeneration
processor = BlipProcessor.from_pretrained("Salesforce/blip-image-captioning-base")
model = BlipForConditionalGeneration.from_pretrained("Salesforce/blip-image-captioning-base")
def generate_caption(raw_image: Image) -> str:
inputs = processor(raw_image, return_tensors="pt")
@briankung
briankung / docker-pry-rails.md
Last active January 2, 2025 05:19
Using pry-rails with Docker

First, add pry-rails to your Gemfile:
https://github.com/rweng/pry-rails

gem 'pry-rails', group: :development

Then you'll want to rebuild your Docker container to install the gems

@ssl1313
ssl1313 / Credit Card Generator
Created January 2, 2025 05:06 — forked from B-Con/Credit Card Generator
This JavaScript function generates random number strings that pass the Luhn checksum, the test that credit card numbers must conform to. It assumes there is an HTML radio input to indicate which company issued the card. This code is from my webpage here: http://bradconte.com/cc_generator.html.
// Copyright (c) 2015, Brad Conte (http://bradconte.com)
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
@B-Con
B-Con / Credit Card Generator
Last active January 2, 2025 05:06
This JavaScript function generates random number strings that pass the Luhn checksum, the test that credit card numbers must conform to. It assumes there is an HTML radio input to indicate which company issued the card. This code is from my webpage here: http://bradconte.com/cc_generator.html.
// Copyright (c) 2015, Brad Conte (http://bradconte.com)
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
@ststeiger
ststeiger / offline_mdn_docs.md
Last active January 2, 2025 05:05 — forked from zed-dz/offline_mdn_docs.md
Offline MDN Docs