This file contains hidden or 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
// Linked data structure part | |
interface Node<T> { | |
previous: Node<T>, | |
value: T, | |
next: Node<T> | |
} | |
// Double-ended queue structure | |
class Deque<T> { | |
private first: Node<T> = null; | |
private last: Node<T> = null; |
This file contains hidden or 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
function createTopScrollbar(frame) { | |
// Target even scrollable? | |
var scrollWidth = frame.get(0).scrollWidth; | |
if(scrollWidth > frame.width()) | |
// Add new top scrollbar and hide default (/bottom) scrollbar | |
frame.before( | |
jQuery('<div />', { | |
css: {'overflow-x': 'scroll'}, | |
height: getScrollbarSize() | |
}) |
This file contains hidden or 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
# Configuration | |
$run_duration_seconds = 10 | |
$read_delay_milliseconds = 500 | |
$log_file = "log.txt" | |
$verbose = $true | |
# Network statistics | |
$statistics = @{} | |
$start_time = Get-Date | |
$end_time = $start_time.addSeconds($run_duration_seconds) |
This file contains hidden or 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
# Configuration | |
$src_folder = "./src" | |
$dst_folder = "./dst" | |
$log_file = "log.txt" | |
# Save paths as absolute | |
$dst_folder = (Get-Item $dst_folder).FullName | |
$log_file = (Get-Item $log_file).FullName | |
# Move to source directory | |
Set-Location -Path $src_folder |
This file contains hidden or 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
# Hide console | |
Add-Type -Namespace User32 -Name Functions -MemberDefinition @" | |
[DllImport("user32.dll")] | |
public static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow); | |
"@ | |
[User32.Functions]::ShowWindowAsync((Get-Process -Id $pid).MainWindowHandle, 0) | |
# Register form objects from .NET | |
[void][reflection.assembly]::loadwithpartialname("System.Windows.Forms") | |
# Create & show simple dialog |
This file contains hidden or 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
/* | |
* The MIT License | |
* | |
* Copyright 2017 Youka. | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is |
This file contains hidden or 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
#!/bin/bash | |
# Ask user for channel | |
read -p "Enter Twitch channel name: " channel | |
# Channel name to lowercase | |
channel=${channel,,} | |
# Open Twitch chat | |
read -p "Open chat (y/n): " open_chat | |
if [ "$open_chat" = "y" ] |
This file contains hidden or 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
CC= i686-w64-mingw32-gcc | |
CFLAGS= -O3 -Wall -Wextra -std=gnu99 -DLUA_COMPAT_5_2 | |
AR= ar rc | |
MKDIR= mkdir -p | |
RM= rm -rf | |
INSTALL= $(CURDIR)/install | |
SOURCES= lapi.c lcode.c lctype.c ldebug.c ldo.c ldump.c lfunc.c lgc.c llex.c lmem.c lobject.c lopcodes.c lparser.c lstate.c lstring.c ltable.c ltm.c lundump.c lvm.c lzio.c lauxlib.c lbaselib.c lbitlib.c lcorolib.c ldblib.c liolib.c lmathlib.c loslib.c lstrlib.c ltablib.c lutf8lib.c loadlib.c linit.c | |
OBJECTS= $(subst .c,.o,$(SOURCES)) |
This file contains hidden or 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 <thread> | |
#include <atomic> | |
#include <functional> | |
#include <windows.h> | |
static thread_local const std::function<void(WPARAM,DWORD)>* LLKP_data; | |
static LRESULT CALLBACK LowLevelKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam){ | |
if(nCode == HC_ACTION) | |
(*LLKP_data)(wParam, reinterpret_cast<PKBDLLHOOKSTRUCT>(lParam)->vkCode); | |
return CallNextHookEx(NULL, nCode, wParam, lParam); |
This file contains hidden or 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 <stdlib.h> | |
#include <stdio.h> | |
#ifdef __SSE2__ | |
#include <emmintrin.h> | |
#endif | |
static double calc_pi(unsigned n){ | |
double pi, x; | |
#ifdef __SSE2__ | |
const __m128d four = _mm_set1_pd(4.0); |