Skip to content

Instantly share code, notes, and snippets.

View zekrom-vale's full-sized avatar
🐲
Dragon

Shawn zekrom-vale

🐲
Dragon
View GitHub Profile
@zekrom-vale
zekrom-vale / glueEnv.r
Last active November 23, 2021 22:04
Computes the full or relative path of a Windows Explorer path with environment variables
library(glue)
#' Computes the full or relative path of a Windows Explorer path with environment variables
#' This makes it compatable to be used in any R path function
#' Ignores case and surounding whitespace
#'
#' @param path The Windows Explorer path
#' @param .open The start of the environment variable
#' @param .close The end of the environment variable
#' @return A full or relative path as text
@zekrom-vale
zekrom-vale / ATXoff.sh
Created July 22, 2020 12:53
SAMBA auto power for ATX NAS
#!/bin/bash
p=`cat /sys/class/gpio/gpio4/value`
if [[ $p -eq 1 ]]; then
sudo systemctl stop smbd
# Change to your mdadm mount point (May be /dev/md127 or somthing due to a bug)
sudo umount /dev/md127
# sudo umount /dev/md/main
# Will return $? != 0 if bussy
while true; do
---
title: "Takeaway 1:Markdown Review 2 2.23.2020"
output:
html_document:
highlight: null
mathjax: null
---
Markdown is a versatile markup syntax that allows us to make good looking reports and API documentation. R markdown is an extension to markdown, meaning you can use any markdown syntax with R markdown.
@zekrom-vale
zekrom-vale / NandGateSignalGenerator.ino
Last active February 20, 2020 01:27
Arduino signal generator, creates 00, 01, 10, 11
int pin1=2;
int pin2=3;
int del=2000;
void setup() {
// put your setup code here, to run once:
pinMode(pin1, OUTPUT);
pinMode(pin2, OUTPUT);
}
@zekrom-vale
zekrom-vale / Powerup.xml
Created September 10, 2019 12:56
Add tasks through xml files
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.3" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2018-11-30T18:15:24.6361279</Date>
<Author>ZEKROM\Zekrom</Author>
<URI>\Dev\Powerup</URI>
</RegistrationInfo>
<Triggers>
<CalendarTrigger>
<StartBoundary>2000-01-01T07:00:00-06:00</StartBoundary>
@zekrom-vale
zekrom-vale / button.akh
Created September 10, 2019 12:43
Rebind a few keys for ease of access
#NoEnv
#NoTrayIcon
#Warn
SendMode Input
SetWorkingDir %A_ScriptDir%
Browser_Search::F5
Ralt::#tab
@zekrom-vale
zekrom-vale / roll.js
Created September 8, 2019 01:01
Roll the dice
"use strict";
var rollPrep=str=>str.replace(/\+-|-/,"+-").split("+");
function roll(str){
var parts=rollPrep(str),
sum=0;
for(let i of parts){
if(i.includes(/d/i)){
i=i.split(/d/i);
let I=Math.abs(i[0]||1);
@zekrom-vale
zekrom-vale / zekrom.html
Created September 8, 2019 00:38
Zekrom Character files in HTML
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/paper/bootstrap.min.css">
<style>
hr{
border-top:1px solid #000
}
:not(div)>:not(div)>div{
font-size:125%
@zekrom-vale
zekrom-vale / revertOffice365_2016.bat
Created September 8, 2019 00:36
Revert Office 365 2016
@echo off
start https://support.office.com/en-us/article/version-and-build-numbers-of-update-channel-releases-ae942449-1fca-4484-898b-a933ea23def7
echo Make sure to disable Microsoft Office 365 updates!
SET /P build= Enter build identifyer to revert to
cd %programfiles%\Common Files\Microsoft Shared\ClickToRun
officec2rclient.exe /update user updatetoversion=16.0.%build%
console.time("test");
Promise.all([
new Promise(r=>chrome.storage.sync.get(null, s=>r(s))),
new Promise(r=>chrome.storage.local.get(null, l=>r(l)))
]).then(x=>console.timeEnd("test"));
console.time("test2");
chrome.storage.sync.get(s=>{
chrome.storage.local.get(l=>console.timeEnd("test2"));
});