Skip to content

Instantly share code, notes, and snippets.

View sharpdressedcodes's full-sized avatar

Greg sharpdressedcodes

View GitHub Profile
@sharpdressedcodes
sharpdressedcodes / Dark.md
Created July 13, 2023 19:28 — forked from rounk-ctrl/Dark.md
Win32 Dark Mode

Dark Mode APIs.

API Signatures.

ShouldAppsUseDarkMode()

Checks whether system is using dark mode or not.
Signature:

using fnShouldAppsUseDarkMode = bool (WINAPI*)(); // ordinal 132

AllowDarkModeForWindow(In HWND hWnd, In bool allow)

@sharpdressedcodes
sharpdressedcodes / hp-bios-update.md
Created December 10, 2022 03:02 — forked from eNV25/hp-bios-update.md
Instructions to Update the BIOS/UEFI for an HP Laptop on Linux

Instructions to Update the BIOS/UEFI for an HP Laptop on Linux

The easiest way to should be to use [HP PC HARDWARE DIAGNOSTICS 4-IN-1 USB KEY][hp-usb-key]. You should use this option if your BIOS/UEFI does not have a "BIOS update" option.

Unfortunately HP's automatic tool only runs on Windows, but it is possible to make a USB key formatted manually by running the self-extracting executable on Wine. You cannot simply extract the executable using 7-zip because the executable needs to do some file generation.

@sharpdressedcodes
sharpdressedcodes / Log1.txt
Created February 11, 2021 01:58 — forked from mz0/Log1.txt
Seagate Central 4 TB
NAS4T:/Data/user0# netstat -lnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:548 0.0.0.0:* LISTEN 2142/afpd
tcp 0 0 0.0.0.0:3689 0.0.0.0:* LISTEN 2204/mt-daapd
tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN 2056/smbd
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 2153/lighttpd
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 2076/vsftpd
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 2030/sshd
tcp 0 0 127.0.0.1:31415 0.0.0.0:* LISTEN 2311/fbarchived

let's suppose you don't have any drive in Seagate Central first of all you need to check if board is ok (you can pass this step an go to Phase 4. if you already know it)

Phase 1 (serial tty)

pre requests

  1. usb-to-tty or Arduino
  2. Screwdriver and card

steps

  1. find J2 connector on board. If sata connector look at the left, and ethernet port look at you - j2 connector is on right of the board and look like this:
@sharpdressedcodes
sharpdressedcodes / check_ga_and_gtm.js
Last active April 7, 2017 04:40
Check for GTM and GA on a web page
(function(){
var gtmContainerId = 'GTM-XXXXXX';
var gaContaierId = 'UA-XXXXXXX-1';
console.log('gtm check', checkGoogleTagManager(gtmContainerId));
console.log('ga check', checkGoogleAnalytics(gaContaierId));
// To test for only the presence of Google Tag Manager, supply a containerId of null.
function checkGoogleTagManager(containerId){
@sharpdressedcodes
sharpdressedcodes / dataLayerGet.js
Created March 15, 2017 02:37
The proper dataLayerGet function
if (!window.dataLayerGet) {
dataLayerGet = function(key, default_value, dataLayer) {
function recurse(clone, old) {
clone = clone || {};
var property;
for (property in old) {
if (old && old.hasOwnProperty(property) && old[property] !== null) {
if (typeof old[property] === 'object') {
if (old[property].hasOwnProperty('length')) {
clone[property] = [];
@sharpdressedcodes
sharpdressedcodes / wallaby.js
Created February 23, 2017 00:06
wallaby config file for homes-site
process.env.BABEL_ENV = 'test';
module.exports = function(wallaby){
return {
files: [
{pattern: 'node_modules/babel-polyfill/dist/polyfill.js', instrument: false},
'test/mock/*.js',
'stubs/*.js',
'test/test-util/*.js',
'app/**/*.js',
@sharpdressedcodes
sharpdressedcodes / auto-slide-gallery-homestolove.js
Created February 17, 2017 01:01
Auto slide gallery on homestolove.com.au

Bulletproof NPM Workflow

Use the Bulletproof Git Workflow, and before code review:

pre-release package

Publish a pre-release version of the package:

@sharpdressedcodes
sharpdressedcodes / bulletproof-git-workflow.md
Created January 20, 2017 03:15 — forked from db/bulletproof-git-workflow.md
bulletproof git workflow

Bulletproof Git Workflow

start working

git checkout master
git pull
git checkout -b feature/my-work
# edit your files