Skip to content

Instantly share code, notes, and snippets.

@guyjin
guyjin / doskey.md
Created March 18, 2016 13:43 — forked from vladikoff/doskey.md
Setup Persistent Aliases & Macros in Windows Command Prompt (cmd.exe) using DOSKey

Setup Persistent Aliases & Macros in Windows Command Prompt (cmd.exe) using DOSKey

Saved from Archive.org, Date: May 14, 2010 Author: Jesse Webb

http://web.archive.org/web/20140330024520/http://devblog.point2.com/2010/05/14/setup-persistent-aliases-macros-in-windows-command-prompt-cmd-exe-using-doskey/

Our development machines here at Point2 are not standardized; we have a mixture of Windows XP, 7, and Mac OSX/Unix computers. I find myself constantly switching back and forth between command prompt interfaces when pair programming. As a result, I catch myself using “ls” to list a directories contents regardless of what system I am on. I am currently using a Windows XP machine for my developer box and I wanted to setup an alias to the “ls” command to actually perform a “dir”. Here is how I accomplished it…

There is a command available in a Window’s shell that let’s you “alias” command to whatever you please: DOSKey. It allows you to create “macros” to execute one or more other commands with a custom nam

@guyjin
guyjin / gist:2d4f02aee09958279b05
Created March 24, 2016 16:26
git ignore rules for pruning down node_modules
node_modules/**/spec
node_modules/**/test
node_modules/**/tests
node_modules/**/example
node_modules/**/examples
node_modules/**/demo
node_modules/**/docs
node_modules/**/bench
@guyjin
guyjin / gulpfile.js
Last active May 17, 2017 18:59
simple gulp setup
var gulp = require('gulp');
var browserSync = require('browser-sync').create();
var cssimport = require("gulp-cssimport");
var url = require("url");
var sass = require('gulp-sass');
var gutil = require('gulp-util');
var wait = require('gulp-wait');
// Static Server + watching scss/html files
gulp.task('serve', function() {
angular.module('fpfs')
.controller('speciesMeasuredPUCtrl', function (pu, $rootScope, contractAbstract, subView,
paymentUnits, contractSpecies, regionalSpecies, growl, Api,
fpfsSession, productsList, unitOfMeasure) {
var pu = this;
pu.regionalSpecies = regionalSpecies;
pu.contractRecord = contractAbstract;
pu.contractAbstract = contractAbstract;
pu.contractSpecies = contractSpecies;
@guyjin
guyjin / hidpi.txt
Created March 16, 2019 17:09 — forked from simX/hidpi.txt
Enable HiDPI mode in Mountain Lion w/o Quartz Debug
sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool YES;
sudo defaults delete /Library/Preferences/com.apple.windowserver DisplayResolutionDisabled;
// by the way, you need to logout and log back in for this to take effect. Or at least that's what
// Quartz Debug says. Who knows, maybe it's lying?
// P.S. Go to [Apple menu --> System Preferences --> Displays --> Display --> Scaled] after logging
// back in, and you'll see a bunch of "HiDPI" resolutions in the list to choose from.
@guyjin
guyjin / gist:037d4b7061ac186d552fe6215a197eb5
Created May 22, 2020 17:54 — forked from 480/gist:3b41f449686a089f34edb45d00672f28
MacOS X + oh my zsh + powerline fonts + visual studio code terminal settings

MacOS X + oh my zsh + powerline fonts + visual studio code (vscode) terminal settings

Thank you everybody, Your comments makes it better

Install oh my zsh

http://ohmyz.sh/

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
@guyjin
guyjin / A.markdown
Created October 21, 2020 00:44 — forked from erickeno/A.markdown
XState + AWS Amplify example

XState + AWS Amplify example

A breakdown of a project that uses XState to manage state for authenticating a user with Cognito, and then finding the authorized application user with an invoked machine.

  1. create auth machine
  2. create auth context
  3. handle AWS authentication
  4. once user authenticates with Cognito, redirect to user route to get user from db
  5. at user route use userMachine service from authMachine to get application user
  6. once associated application user is found, send user to organization route to allow user to associate session with specific organization
@guyjin
guyjin / machine.js
Last active May 6, 2024 11:22
Generated by XState Viz: https://xstate.js.org/viz
const jobsMachineConfig = Machine({
id: "jobsAdmin",
initial: "loading",
context: {
jobs: undefined,
selectedJob: undefined,
error: undefined,
},
states: {
loading: {
@guyjin
guyjin / machine.js
Created November 23, 2020 20:32
Generated by XState Viz: https://xstate.js.org/viz
const jobsMachineConfig = Machine({
id: "jobsAdmin",
initial: "loading",
context: {
jobs: [],
jobCategory: "All",
jobPolling: true,
selectedJob: undefined,
error: undefined,
},
@guyjin
guyjin / JS-One-Liners
Last active May 6, 2024 11:18
JS One-liner collection
just a collection of js one-liners from around the web.