Skip to content

Instantly share code, notes, and snippets.

@MadLittleMods
MadLittleMods / command-runner-promisified-exec.js
Last active November 23, 2020 19:47
child_process, shell
var Promise = require('bluebird');
var exec = require('child_process').exec;
var commandRunner = function(command) {
return new Promise(function(resolve, reject) {
var child = exec(command, function(err, stdout, stderr) {
var resultInfo = {
command: command,
stdout: stdout,
stderr: stderr,

Just some notes and references for myself.

  • In bash, you can access your C:\ drive via /mnt/c/
  • ~ = C:\Users\MLM\AppData\Local\lxss\home\mlm and is different from your Windows user directory C:\Users\MLM

How to google things

Just some personal git-foo I want to reference.

  • git commit --amend: Shove changes onto last commit (easy rebase if you want to add more to previous commit)
  • git config --list: I use it to find if the clone is using https or ssh
    • git config remote.origin.url [email protected]: Set your project to use SSH (grab the full SSH URL from the repo page)
  • git fetch && git diff master..origin/master --name-status: Get list of incoming changes from the remote origin.
    • --name-only For just names
  • git filter-branch: If you want to remove some changes to some files in a branch across all commits in the feature-branch.
    • git filter-branch --force --tree-filter 'git checkout {some-commit-sha} -- some-file.js; {other-commands-if-you-want-like-rm-or-other-git-checkouts}' --prune-empty develop..feature/some-feature-branch
  • git show :/myqueryhere: search commits
var Halley = require('halley');
var ClientAuthExt = require('./lib/client-auth-ext');
var config = require('./config.json');
var client = new Halley.Client('https://ws.gitter.im/bayeux');
client.addExtension(new ClientAuthExt({
token: config.token
}));
var gulp = require('gulp');
var through = require('through2');
gulp.task('replace-dep', function() {
var replaceDep = function() {
return through.obj(function(chunk, enc, callback) {
if(chunk.isBuffer()) {
var contents = String(chunk.contents);
var spacebarKey = 32;
var enterKey = 13;
var checkIfActivationEvent = function(e) {
if(e.type === 'click' || (e.type === 'keydown' && (e.keyCode === spacebarKey || e.keyCode === enterKey))) {
return true;
}
return false;
};
  1. Switch your Sata Config in the BIOS. If you already have an existing Windows system, you will need to follow these steps to get the Windows driver working for RAID otherwise you will run into INACCESSIBLE_BOOT_DEVICE bleu screen error when booting
    1. Source: http://www.tenforums.com/drivers-hardware/15006-attn-ssd-owners-enabling-ahci-mode-after-windows-10-installation.html
    2. In Windows, Run Command Prompt as Admin
    3. Invoke safe mode boot with this command: bcdedit /set {current} safeboot minimal
    4. Restart the PC and enter your BIOS during bootup (DEL key)
    5. Change from AHCI to RAID mode then Save & Exit.
    6. Setup the RAID array by pressing Ctrl+I on boot -> Create RAID Volume, etc
    7. Windows 10 will then launch in Safe Mode.
    8. Once booted, Right click the Window icon and select to run the Command Prompt in Admin mode from among the various options.
  2. Cancel Safe Mode booting with the command: bcdedit /deletevalue {current} safeboot

References:

I have tried this on Verizon Moto E devices with and without the Android 5.1 update. I have also run this on a Windows and Mac OSX machine. I have used T-mobile(US) and EE(UK) sims.

Everytime you swap the sim with the Android 5.1 fix, you need to re-run the adb commands.

@MadLittleMods
MadLittleMods / .stylelintrc
Created January 2, 2016 03:04
Plaudit .stylelintrc 2015-12-4
{
"rules": {
"string-quotes": [2, "single"],
"color-hex-case": [2, "lower"],
"color-no-invalid-hex": 2,
"number-leading-zero": [2, "always"],
"number-no-trailing-zeros": 2,
"number-zero-length-no-unit": 2,