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 Github Tab Size | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Changes GitHub's tab size | |
// @author DaCurse | |
// @match https://github.com/* | |
// @icon https://github.githubassets.com/favicons/favicon.svg | |
// @grant none | |
// ==/UserScript== |
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 { createTheme, ThemeProvider } from '@material-ui/core/styles'; | |
import React, { createContext, useEffect, useState } from 'react'; | |
const darkTheme = createTheme({ | |
palette: { | |
type: 'dark', | |
}, | |
}); | |
const lightTheme = createTheme({ | |
palette: { |
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 * as bcrypt from 'bcrypt'; | |
function benchmarkHashSync(password, rounds) { | |
console.time('bcrypt-sync'); | |
const salt = bcrypt.genSaltSync(rounds); | |
const hash = bcrypt.hashSync(password, salt); | |
console.timeEnd('bcrypt-sync'); | |
console.log(hash); | |
} |
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
Char_Count = 26 | |
Loop, %Char_Count% { | |
Key := GetKeyName(Chr(A_Index + Asc("a") - 1)) | |
Hotkey, %Key%, KeyHandler | |
} | |
Return | |
KeyHandler: | |
Start_Value := 0x1F1E6 |
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
from ctypes import windll | |
from sys import executable | |
from os import popen | |
def is_admin(): | |
try: | |
return windll.shell32.IsUserAnAdmin() | |
except: | |
return False |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <time.h> | |
#define MUTATE_RATE .01 | |
#define BREED_RATE .75 | |
#define POP_SIZE 10000 | |
#define ELDERS_SIZE POP_SIZE * (1 - BREED_RATE) |
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
public class DynamicArray<T> { | |
protected Object[] items; | |
// Empty dynamic array | |
public DynamicArray() { | |
items = new Object[] {}; | |
} | |
// Copy another dynamic array |
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
class WSFrame { | |
constructor(buffer) { | |
if(buffer.byteLength < 2) { | |
throw new Error('Incomplete frame: Header data missing'); | |
} | |
this.fin = 0; | |
this.opcode = 0; | |
this.mask = 0; |
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
Date.prototype.dateNames = {}; | |
Date.prototype.dateNames.days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; | |
Date.prototype.dateNames.shortDays = Date.prototype.dateNames.days.map(day => { | |
return day.substr(0, 3); | |
}); | |
Date.prototype.dateNames.months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']; | |
Date.prototype.dateNames.shortMonths = Date.prototype.dateNames.months.map(month => { | |
return month.substr(0, 3); | |
}); |