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 <windows.h> /* WinAPI */ | |
/* Windows sleep in 100ns units */ | |
BOOLEAN nanosleep(LONGLONG ns){ | |
/* Declarations */ | |
HANDLE timer; /* Timer handle */ | |
LARGE_INTEGER li; /* Time defintion */ | |
/* Create timer */ | |
if(!(timer = CreateWaitableTimer(NULL, TRUE, NULL))) | |
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
// Lua C API | |
#include <lua.hpp> | |
// C++ input/output streams | |
#include <iostream> | |
// MyObject as C++ class | |
class MyObject{ | |
private: | |
double x; | |
public: |
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
@echo off | |
rem Resize window for following masses of content | |
mode 200,50 | |
rem Get CPU information | |
echo # CPU | |
wmic CPU GET AddressWidth,CurrentClockSpeed,CurrentVoltage,L2CacheSize,L3CacheSize,LoadPercentage,Manufacturer,Name,NumberOfCores,NumberOfLogicalProcessors | |
echo. | |
rem Get graphics card information |
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
-- Load foreign-function-interface handle | |
local ffi = require("ffi") | |
-- Shortcut FFI C namespace | |
local C = ffi.C | |
-- Load Windows kernel32 DLL | |
local kernel32 = ffi.load("kernel32") | |
-- Add C definitions to FFI for usage descriptions of components | |
ffi.cdef([[ | |
// Redefinitions for WinAPI conventions | |
typedef void VOID; |
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
const InfoCollapsePlugin = (system) => { | |
const React = system.React; | |
return { | |
wrapComponents: { | |
info: (Original) => (props) => React.createElement( | |
"details", | |
{ | |
open: true | |
}, | |
React.createElement( |
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
-- Load FFI | |
local ffi = require("ffi") | |
-- Define FFI functions & structures by OS | |
local x11 | |
if ffi.os == "Windows" then | |
ffi.cdef([[ | |
typedef int BOOL; | |
typedef long LONG; | |
typedef struct{ |
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
new (require('ws').Server)({port:8080}).on('connection',sock=>sock.on('message',data=>sock.send(String(data)))) |
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
#[cfg(feature = "gpgpu")] | |
mod gpgpu { | |
// Imports | |
use ocl::{ | |
Platform, | |
Device, | |
enums::{ | |
PlatformInfo, | |
DeviceInfo | |
}, |
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
#! /bin/bash | |
# HELPERS | |
# Variables | |
pkg_install="yum -y install" | |
pkg_installed="yum list installed" | |
pkg_clean="yum clean all" | |
pkg_update="yum -y update" | |
service_enable="systemctl enable" | |
service_start="systemctl start" |
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
// 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; |
NewerOlder