Skip to content

Instantly share code, notes, and snippets.

@nebriv
nebriv / DDM2.0.md
Last active June 22, 2024 16:00
Dell Display Manager 2.0 command line documentation

Dell Display Manager 2.0 Command Line

Decompiled DLL with ILSpy to identify various commands.

Most commands can be found in DDM2._0_UX.CmdBackground.cmdService_DoWork

Write commands can be prefixed with int:command to specify which monitor to send the command to.

.\DDM.exe /0:writebrightnesslevel 50

@wojteklu
wojteklu / clean_code.md
Last active July 4, 2024 07:59
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@enzoaeneas
enzoaeneas / ko.utils.3.4.0rc.signatures.js
Created December 30, 2015 21:48 — forked from hyle/ko.utils.3.4.0.signatures.js
KnockoutJS 3.4.0rc utils (ko.utils) signatures
// knockout 3.4.0rc
ko.utils.addOrRemoveItem = function (array, value, included) { /* .. */ }
ko.utils.anyDomNodeIsAttachedToDocument = function (nodes) { /* .. */ }
ko.utils.arrayFilter = function (array, predicate) { /* .. */ }
ko.utils.arrayFirst = function (array, predicate, predicateOwner) { /* .. */ }
@hyle
hyle / ko.utils.3.4.0.signatures.js
Last active September 25, 2018 09:12
KnockoutJS 3.4.0 / 3.4.1 / 3.4.2 utils (ko.utils) signatures
// knockout 3.4.0
ko.utils.addOrRemoveItem = function (array, value, included) { /* .. */ }
ko.utils.anyDomNodeIsAttachedToDocument = function (nodes) { /* .. */ }
ko.utils.arrayFilter = function (array, predicate) { /* .. */ }
ko.utils.arrayFirst = function (array, predicate, predicateOwner) { /* .. */ }
@kamranayub
kamranayub / Generate-OfflineManifest.ps1
Last active September 21, 2016 20:24
PowerShell script to build an HTML5 application manifest file
<#
.SYNOPSIS
Generates an HTML5 offline app cache manifest file
.DESCRIPTION
Generates an offline app cache manifest file according to file paths specified
and outputs with MD5 checksums so manifest only changes when dependent files change.
@shawndube
shawndube / CreateClassFromDBTableSchema
Created April 24, 2015 19:29
I needed a way to generate simple classes for some tables across SQL version 2012 to 6.5. Based on Stack Overflow answer from Alex Aza: http://stackoverflow.com/a/5873231/331937
SET STATISTICS IO OFF
SET NOCOUNT ON
-- =============================================
-- Author: Shawn Dube, twitter: @shawndube
-- Create date: 4/24/15
-- Based on work by Alex Aza: http://stackoverflow.com/a/5873231/331937
-- Uses: Initial use was to create C# Classes
-- from an existing database table schema.
-- May be able to do other templating type
@WebReflection
WebReflection / String.prototype.template.js
Last active August 17, 2022 04:04
ES6 Template like strings in ES3 compatible syntax.
// this is now a module:
// https://github.com/WebReflection/backtick-template#es2015-backticks-for-es3-engines--
var template = require('backtick-template');
// just string
const info = 'template';
`some ${info}` === template('some ${info}', {info});
@mkchandler
mkchandler / DisableNuGetPackageRestore.ps1
Last active February 13, 2018 04:07
Disable the NuGet Package Restore functionality in a Visual Studio solution.
# Usage: .\DisableNuGetPackageRestore.ps1 C:\Path\To\Solution.sln
# Get the path that the user specified when calling the script
$solution = $args[0]
$solutionPath = Split-Path $solution -Parent
$solutionName = Split-Path $solution -Leaf
# Delete the .nuget directory and all contents
Remove-Item (Join-Path $solutionPath ".nuget") -Force -Recurse -ErrorAction 0
@tantaman
tantaman / IndexedDB-storing-and-retrieving-files.js
Last active April 4, 2021 22:10 — forked from robnyman/IndexedDB-storing-and-retrieving-files.js
Download an image, save it to IndexedDB, read it out, display the image via createObjectURL - works in Chrome and Firefox. Based on https://hacks.mozilla.org/2012/02/storing-images-and-files-in-indexeddb/ but with fixes made for Chrome.
(function () {
// IndexedDB
function BrowserType() {
var n = navigator.appName;
var ua = navigator.userAgent;
var tem;
var m = ua.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i);
if (m && (tem = ua.match(/version\/([\.\d]+)/i)) != null) m[2] = tem[1];
m = m ? [m[1], m[2]] : [n, navigator.appVersion, '-?'];
@joey-qc
joey-qc / TSQL-to-POCO
Created September 26, 2013 06:56
A simple TSQL script to quickly generate c# POCO classes from SQL Server tables and views. You may tweak the output as needed. Not all datatypes are represented but this should save a bunch of boilerplate coding. USAGE: Run this query against the database of your choice. The script will loop through tables, views and their respective columns. Re…
declare @tableName varchar(200)
declare @columnName varchar(200)
declare @nullable varchar(50)
declare @datatype varchar(50)
declare @maxlen int
declare @sType varchar(50)
declare @sProperty varchar(200)
DECLARE table_cursor CURSOR FOR