Skip to content

Instantly share code, notes, and snippets.

@benlansdell
benlansdell / filepicker.py
Last active May 9, 2024 21:24
FilePicker for streamlit
"""FilePicker for streamlit.
Still doesn't seem to be a good solution for a way to select files to process from the server Streamlit is running on.
Here's a pretty functional solution.
Usage:
```
import streamlit as st

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r
@backroot
backroot / get_http_header.cgi
Last active May 9, 2024 21:19
Get HTTP Headers by perl
#!/usr/bin/perl --
use strict;
use warnings;
use CGI;
my $q = CGI->new;
my %headers = map { $_ => $q->http($_) } $q->http();
print $q->header('text/plain');
print "------------------------------\n";
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active May 9, 2024 21:19
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@jmalarcon
jmalarcon / Northwind.md
Last active May 9, 2024 21:18
Northwind Reborn - Base de datos de ejemplo de SQL Server

Instalar la base de datos de ejemplo Northwind

Para instalar la Base de Datos de ejemplo Northwind:

  • Descarga el ZIP que tienes en este enlace. y descomprímelo en cualquier carpeta de tu equipo. Dentro hay un archivo llamado northwind.sql.
  • Abre SQL Server Management Studio COMO ADMINISTRADOR, arrastra el archivo anterior sobre éste, y simplemente ejecuta el Script de instalación Northwind.sql pulsando F5 para ejecutarlo.

Tras haberlo ejecutado se creará una base de datos de nombre Northwind y se rellenará con los datos de ejemplo.

¡Espero que te sea útil!

@nowl
nowl / perlin.c
Created February 15, 2011 19:04
Perlin Noise in C
#include <stdio.h>
static int SEED = 0;
static int hash[] = {208,34,231,213,32,248,233,56,161,78,24,140,71,48,140,254,245,255,247,247,40,
185,248,251,245,28,124,204,204,76,36,1,107,28,234,163,202,224,245,128,167,204,
9,92,217,54,239,174,173,102,193,189,190,121,100,108,167,44,43,77,180,204,8,81,
70,223,11,38,24,254,210,210,177,32,81,195,243,125,8,169,112,32,97,53,195,13,
203,9,47,104,125,117,114,124,165,203,181,235,193,206,70,180,174,0,167,181,41,
164,30,116,127,198,245,146,87,224,149,206,57,4,192,210,65,210,129,240,178,105,
@craSH
craSH / Password.java
Last active May 9, 2024 21:17
A simple example Java class to safely generate and verify bcrypt password hashes for use in authentication systems.
/**
* Author: Ian Gallagher <igallagher@securityinnovation.com>
*
* This code utilizes jBCrypt, which you need installed to use.
* jBCrypt: http://www.mindrot.org/projects/jBCrypt/
*/
public class Password {
// Define the BCrypt workload to use when generating password hashes. 10-31 is a valid value.
private static int workload = 12;
@LotteMakesStuff
LotteMakesStuff / CustomInspectorCreator.cs
Last active May 9, 2024 21:17
Editor extension that adds a tool to automagically generate boilerplate custom inspector code~ YES! Just drop it into a folder called 'Editor' and it adds a 'custom inspector' option into the Project window!
using UnityEngine;
using UnityEditor;
using System.IO;
public static class CustomInspectorCreator
{
[MenuItem("Assets/Create/Custom Inspector", priority = 81)]
static void CreateInsptorEditorClass()
{
foreach (var script in Selection.objects)
@michaelbutler
michaelbutler / Install_PHP_on_Arch_Manjaro.md
Last active May 9, 2024 21:12
Install multiple PHP versions on Arch / Manjaro Linux

Install Any PHP on Arch / Manjaro

Through the AUR it is possible to install older and newer PHP versions, simultaneously on the same system. I often had trouble installing using pacman and pamac so here's what I did:

mkdir -p $HOME/bin
mkdir ~/src
cd ~/src
git clone https://aur.archlinux.org/php81.git
cd php81
@OrionReed
OrionReed / dom3d.js
Last active May 9, 2024 21:12
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯