Skip to content

Instantly share code, notes, and snippets.

@ptvans
ptvans / _.md
Created August 9, 2014 08:11
flying-fuck
@ThioJoe
ThioJoe / DisableUSBPowerManagement.ps1
Last active May 1, 2024 20:38
PowerShell script to disable Windows power management on all currently connected serial ports, including most (if not all) USB devices and adapters.
# PowerShell script to disable Windows power management on all currently connected serial ports, including USB adapters
# In simpler terms, it prevents Windows from turning off connected serial devices to save power.
# Equivalent to right-clicking on a serial port device in Device Manager > Properties > "Power Management" Tab > Unchecking "Allow the computer to turn off this device to save power."
$hubs = Get-CimInstance -ClassName Win32_SerialPort | Select-Object Name, DeviceID, Description
$powerMgmt = Get-CimInstance -ClassName MSPower_DeviceEnable -Namespace root\wmi
foreach ($p in $powerMgmt) {
$IN = $p.InstanceName.ToUpper()
foreach ($h in $hubs) {
@pasupulaphani
pasupulaphani / after_res_hooks.js
Last active May 1, 2024 20:37
Mongoose connection best practices
var db = mongoose.connect('mongodb://localhost:27017/DB');
// In middleware
app.use(function (req, res, next) {
// action after response
var afterResponse = function() {
logger.info({req: req}, "End request");
// any other clean ups
@amakukha
amakukha / Play2Tones.ino
Last active May 1, 2024 20:36
Play duo melody with Arduino
/*
* Play duo melody with Arduino
* ============================
*
* Description:
* This sketch simultaneously plays two separate melodies on two (passive)
* speakers or buzzers. This creates effect of a "choir".
* For simplicity, it uses function play2Tones(), which only plays two notes
* of equal duration simultaneosly.
* The actual melody here is the Anthem of Ukraine.
@Skylarkroam
Skylarkroam / background.js
Created March 11, 2019 18:57
Vivid Browser
//added to git
// chrome.windows.getAll({}, function (winArr) {
// // print(winArr)
// for (var win of winArr) {
// SinWave(win);
// }
// });
// function SinWave(win) {
@deenie1
deenie1 / build.gradle.kts
Created May 1, 2024 20:34 — forked from marcellogalhardo/build.gradle.kts
Root gradle.build.kts global settings for KAPT
allprojects {
afterEvaluate {
// Global KAPT flags applied to all projects.
extensions.findByType<KaptExtension>()?.apply {
// Do not replace unknown types (including types for the generated classes) by NonExistentClass.
correctErrorTypes = true
// Provide links to locations in the original Kotlin code rather than generated Java stubs
// as it reports errors encountered during annotation processing.
@weirdoonthebus
weirdoonthebus / index.html
Created December 10, 2016 21:09
Right Now
<!--
photo background by marcelo quinan via unsplash: https://unsplash.com/marceloquinan -->
<header id="header"><h1>Right Now</h1><form><input id="search" type="text"placeholder="Search or say 'Ok Google'"></form></header>
<article>
<section id="section"></section>
<section></section>
<section></section>
<section></section>
<section></section>
</article>
@weirdoonthebus
weirdoonthebus / adventure-time-origami.markdown
Created December 10, 2016 21:06
Adventure Time Origami
@MakotoIshikawa
MakotoIshikawa / 01_SharePointWebPartFolding.html
Last active May 1, 2024 20:34
SharePoint の Web パーツを開閉する
<style>
.ms-webpart-chrome h2 {
position: relative;
margin: 0 0 4px;
padding: 0.8em 0 0.8em 1.5em;
border: 2px solid #993366;
font-size: 1.143em;
font-weight: bold;
background-color: #FFEEFF;
}
@harunpehlivan
harunpehlivan / index.html
Created December 7, 2021 21:35
User Profile
<!-- main -->
<section class="main">
<div class="points"></div>
<div class="shield-left"></div>
<div class="shield-right"></div>
<!-- card -->
<div class="card">
<div class="detail">
<div class="detail-images"><img src="https://assets.codepen.io/76692/internal/avatars/users/default.png?fit=crop&format=auto&height=80&version=1523479757&width=80" alt="Picture"></div>
<h3>HARUN PEHLİVAN </h3>