Skip to content

Instantly share code, notes, and snippets.

View ayunami2000's full-sized avatar
πŸ‘Œ
No u

ayunami2000

πŸ‘Œ
No u
View GitHub Profile
@gogromat
gogromat / concat.array.buffers.js
Last active July 11, 2023 16:31
Concatenate n-many ArrayBuffers
/**
* Concatenates n-many ArrayBuffers
* Based on the https://gist.github.com/72lions/4528834
*
* @param {...ArrayBuffer} ArrayBuffer(s) to concatenate
* @return {ArrayBuffer} The new ArrayBuffer created out of n buffers.
*/
var concatArrayBuffers = function () {
var buffers = Array.prototype.slice.call(arguments),
buffersLengths = buffers.map(function(b) { return b.byteLength; }),
@air
air / p1_keyboard.ini
Created October 11, 2015 01:12
Dolphin profiles for New Super Mario Bros
[Profile]
Device = DInput/0/Keyboard Mouse
Buttons/A = X
Buttons/B = C
Buttons/1 = LSHIFT
Buttons/2 = SPACE
Buttons/- = V
Buttons/+ = B
Shake/X = Z
Shake/Y = Z
@TobleMiner
TobleMiner / nein.java
Created January 13, 2016 19:16
ARGB to RGB blend
public static int convertARGBtoRGB(int argbValue)
{
int rgb = 0;
// Extract bit 24 - 31 and discard sign (& 0xFF)
double alpha = ((argbValue >> 24) & 0xFF) / 255d;
for(int i = 0; i <= 16; i += 8)
{
// Extract color channel
int channel = argbValue >> i & 0xFF;
@nepsilon
nepsilon / how-to-git-patch-diff.md
Last active November 4, 2025 07:16
How to generate and apply patches with git? β€” First published in fullweb.io issue #33

How to generate and apply patches with git?

It sometimes happen you need change code on a machine from which you cannot push to the repo. You’re ready to copy/paste what diff outputs to your local working copy.

You think there must be a better way to proceed and you’re right. It’s a simple 2 steps process:

1. Generate the patch:

git diff &gt; some-changes.patch
@htp
htp / curl-websocket.sh
Last active November 13, 2025 12:37
Test a WebSocket using curl.
curl --include \
--no-buffer \
--header "Connection: Upgrade" \
--header "Upgrade: websocket" \
--header "Host: example.com:80" \
--header "Origin: http://example.com:80" \
--header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \
--header "Sec-WebSocket-Version: 13" \
http://example.com:80/
@emilmelnikov
emilmelnikov / keylogger.py
Created December 9, 2016 13:56
Scancode converter for QEMU keyboard debug output
#!/usr/bin/env python3
"""Intercept scancodes from QEMU log output."""
import argparse
import collections
import csv
import enum
@mindplace
mindplace / git_and_github_instructions.md
Last active December 9, 2025 02:54
Pushing your first project to github

1. Make sure git is tracking your project locally

Do you need a refresher on git? Go through Codecademy's git course.

  1. Using your terminal/command line, get inside the folder where your project files are kept: cd /path/to/my/codebase. β†’ You cannot do this simply by opening the folder normally, you must do this with the command line/terminal.
    β†’ Do you need a refresher on using your command line/terminal? I've compiled my favorite resources here.

  2. Check if git is already initialized: git status

@naotokui
naotokui / melody_extraction.ipynb
Created May 8, 2017 14:12
extract melody from audio
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hallzy
hallzy / set-proxy-for-whole-machine.cmd
Last active February 9, 2022 16:51
Please read the Notes at the top of each of the scripts before you run them. Set Windows IE proxy with a cmd file, or set Windows IE proxy globally by changing the "DefaultConnectionSettings" registry key as well as "ProxySettingsPerUser" and "Proxy" for GPO settings. PLEASE SAVE A COPY OF YOUR REGISTRY JUST IN CASE YOU NEED TO GO BACK!
:: NOTE: If you don't want to make proxy settings for the whole machine,
:: find the line in this script that starts with "reg add" and change
:: "HKLM" to "HKCU" so that it only affects the current user (or change it
:: to reflect the specific hive that you want to change)
:: Supported Characters in proxy server address (if you need more, consult
:: an ascii table and make a new "if" statement for the character you need,
:: but these should suffice):
:: * - . / : ; = ? @ ~ < >
:: All Numbers
@IceCreamYou
IceCreamYou / regex-wordwrap.js
Created September 9, 2017 09:33
Implements simple character-count-based word wrapping with regular expressions in JavaScript
/**
* Wraps the specified string onto multiple lines by character count.
*
* Words (consecutive non-space characters) are not split up.
* Lines may be shorter than `len` characters as a result.
* Careful: words longer than `len` will be dropped!
*
* @param str The string to wrap.
* @param len The max character count per line.
*