This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.nio.ByteBuffer; | |
public class UTF8 { | |
public static void encodeUTF8(char c, ByteBuffer buf) { | |
if (c <= 0x7F) { | |
buf.put((byte) c); | |
} else if (c <= 0x7FF) { | |
buf.put((byte) (0b11000000 | (c >> 6))); | |
buf.put((byte) (0b10000000 | (c & 0b111111))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name De-tab Twitter | |
// @namespace https://whizvox.me | |
// @version 1.1.1 | |
// @downloadURL https://gist.githubusercontent.com/whizvox/2c5eb769c29576bdf4173ac2ee58445a/raw/38eba91a8c3da6da262de56bcd6ce712e153af04/detabtwt.js | |
// @description Removes "For You" and "Following" tabs, as well as selecting "Following" upon page load | |
// @author whizvox | |
// @match https://twitter.com/home | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=twitter.com | |
// @grant none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "DynamicArray.hpp" | |
#include <cstring> | |
void copyArray(int* dst, const int* src, int n) { | |
for (int i = 0; i < n; i++) { | |
dst[i] = src[i]; | |
} | |
} | |
DynamicArray::DynamicArray(int capacity) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
template<class T> | |
int partition(T*, const int, const int); | |
template<class T> | |
void quicksort(T*, int, int); | |
template<class T> | |
void quicksort(T*, const int); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.nio.ByteBuffer; | |
import java.nio.CharBuffer; | |
/** | |
* Do you want to know how to encode and decode in UTF8 format without relying on another library? Well, here ya go. | |
* Reference Guide: http://www.fileformat.info/info/unicode/utf8.htm | |
*/ | |
public class UTF8Encoding { | |
public static void main(String[] args) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.joml.Matrix4f; | |
import org.lwjgl.BufferUtils; | |
import org.lwjgl.glfw.GLFWErrorCallback; | |
import org.lwjgl.glfw.GLFWKeyCallback; | |
import org.lwjgl.glfw.GLFWVidMode; | |
import org.lwjgl.glfw.GLFWWindowSizeCallback; | |
import org.lwjgl.opengl.GL; | |
import java.nio.ByteBuffer; | |
import java.nio.FloatBuffer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.lwjgl.BufferUtils; | |
import org.lwjgl.glfw.GLFWErrorCallback; | |
import org.lwjgl.glfw.GLFWKeyCallback; | |
import org.lwjgl.glfw.GLFWVidMode; | |
import org.lwjgl.glfw.GLFWWindowSizeCallback; | |
import org.lwjgl.opengl.GL; | |
import java.nio.ByteBuffer; | |
import java.nio.FloatBuffer; | |
import java.nio.IntBuffer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.lwjgl.BufferUtils; | |
import org.lwjgl.glfw.GLFW; | |
import org.lwjgl.glfw.GLFWErrorCallback; | |
import org.lwjgl.glfw.GLFWKeyCallback; | |
import org.lwjgl.opengl.GL; | |
import org.lwjgl.opengl.GL11; | |
import org.lwjgl.opengl.GL15; | |
import org.lwjgl.stb.STBImage; | |
import java.nio.ByteBuffer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.swing.*; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.RandomAccessFile; | |
import java.net.HttpURLConnection; | |
import java.net.URL; | |
import java.util.Observable; | |
public class Downloader extends Observable implements Runnable { |