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
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
// On stable: <https://doc.rust-lang.org/std/collections/struct.HashMap.html#method.get_key_value> | |
pub fn get_key_value<'a,K,V,Q: ?Sized>(map: &'a HashMap<K,V>, k: &Q) -> Option<(&'a K, &'a V)> | |
where K: std::borrow::Borrow<Q> + std::hash::Hash + std::cmp::Eq, | |
Q: std::hash::Hash + Eq { | |
let key = map.keys().find(|key| key.borrow() == k)?; | |
Some((key, map.get(key.borrow())?)) | |
} |
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
use std::env; | |
fn main() { | |
// Multisampling not supported on CI machine, else 8 samples are absolutely enough | |
println!("cargo:rustc-env=SAMPLES={}", if env::var("TRAVIS_RUST_VERSION").is_ok() {1} else {8}); | |
} |
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
function hex2RGBA(hex: string) { | |
if(hex !== null && hex.charAt(0) === '#') { | |
const pattern = /[0-9a-f]{1,2}/ig, | |
rgba = [0, 0, 0, 255]; | |
for( | |
let i = 0, match; | |
i < 4 && (match = pattern.exec(hex)) !== null; | |
i++ | |
) | |
rgba[i] = parseInt(match.toString(), 16); |
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; |
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
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() | |
}) |
NewerOlder