Skip to content

Instantly share code, notes, and snippets.

View auzwang's full-sized avatar

Zhe Wang auzwang

View GitHub Profile
@auzwang
auzwang / Localz Driver Tracker Challenge.md
Last active December 13, 2019 06:21
Localz Driver Tracker Challenge

Localz Driver Tracker

Localz is building a platform to track driver locations as they deliver parcels.

A driver logs into their device and begins submitting location. This location will be used for the customer to track the driver on a map.

Requirements

Please conform to the requirements below, we do not expect you to go beyond these. This is a server-side challenge.

@auzwang
auzwang / .extra
Created April 21, 2015 04:14
bash extras
function woff() {
# get current wifi device
CURRENT_DEVICE=$(networksetup -listallhardwareports | awk '$3=="Wi-Fi" {getline; print $2}')
echo "Current Wi-Fi Device = '$CURRENT_DEVICE'"
# turn off wifi
networksetup -setairportpower $CURRENT_DEVICE off
}
function won() {
@auzwang
auzwang / observer.js
Last active August 29, 2015 14:15
Object.observe Observer Callback Snippet
(function () {
'use strict';
function observer(changes) {
changes.forEach(function (change) {
console.log(change);
});
}
window.observer = observer;
@auzwang
auzwang / Script.cshtml
Created January 2, 2015 00:45
Ext Locale Load Order
@if (Html.HaveExtJsLocaleFileForUser(Request)) {
<text>
Ext.Loader.loadScript({ url: '@Url.StaticContent("/libraries/extjs/4.2.0/locale/" + @Html.ConvertUserLanguagePreferenceToExtjsLocaleFileName(@Request))' });
</text>
}
function hosts() {
if [ "$1" = "open" ]; then
open /c/windows/system32/drivers/etc/hosts;
return;
fi
if [ -z "$1" ]; then
echo "cat /c/windows/system32/drivers/etc/hosts";
cat /c/windows/system32/drivers/etc/hosts;
return;
define ["exports"], (exports) ->
breadcrumbBarAlias = "web-workspace-breadcrumbbar"
breadcrumbBarItemAlias = "web-container-breadcrumbitem"
exports.navigateTo = (areaName) ->
chain.start(-> browser.waitAndSelectComponent breadcrumbBarAlias)
.then((breadcrumbBar) ->
itemWithArea = null
breadcrumbBarItems = breadcrumbBar.query(breadcrumbBarItemAlias)
breadcrumbBarItems.forEach (item) ->
item.menuItems.some (menuItem) ->