Skip to content

Instantly share code, notes, and snippets.

View atwayne's full-sized avatar

Wayne Wang atwayne

  • Shanghai
  • 13:41 (UTC +08:00)
View GitHub Profile
@atwayne
atwayne / .npmrc
Created December 7, 2022 07:36
.npmrc with npmmirror
registry=https://registry.npmmirror.com
sass_binary_site=https://npmmirror.com/mirrors/node-sass/
phantomjs_cdnurl=https://npmmirror.com/mirrors/phantomjs/
electron_mirror=https://npmmirror.com/mirrors/electron/
sqlite3_binary_host_mirror=http://npmmirror.com/mirrors/
profiler_binary_host_mirror=http://npmmirror.com/mirrors/node-inspector/
chromedriver_cdnurl=https://npmmirror.com/mirrors/chromedriver
sentrycli_cdnurl=https://npmmirror.com/mirrors/sentry-cli/
@atwayne
atwayne / SystemCommand.cs
Last active August 16, 2022 17:23
executes a string as an internal operating system command
using System.Runtime.InteropServices;
[DllImport("msvcrt.dll")]
static extern int system(string command);
// Ref: https://docs.microsoft.com/en-us/cpp/c-language/system-function?view=msvc-170
@atwayne
atwayne / EmbeddedHttpServer.cs
Last active November 3, 2021 15:42
An in-memory HTTP server. Created for unit test
using System;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace TetraPak.PIExecution.Subscriber.Clients.Tests
{
public static class EmbeddedHttpServer
# Install with
# New-Item -Path $profile -ItemType File -Force
# Remove alias where -> Where-Object
Remove-Item alias:\where -Force
function prompt {
$dir = $ExecutionContext.SessionState.Path.CurrentLocation.Path
Write-Host ("["+$dir+"]$") -ForegroundColor Magenta -NoNewline
return " "

I'm drunk and I'll probably regret this, but here's a drunken rank of things I've learned as an engineer for the past 10 years.

  • The best way I've advanced my career is by changing companies.
  • Technology stacks don't really matter because there are like 15 basic patterns of software engineering in my field that apply. I work in data so it's not going to be the same as webdev or embedded. But all fields have about 10-20 core principles and the tech stack is just trying to make those things easier, so don't fret overit.
  • There's a reason why people recommend job hunting. If I'm unsatisfied at a job, it's probably time to move on.
  • I've made some good, lifelong friends at companies I've worked with. I don't need to make that a requirement of every place I work. I've been perfectly happy working at places where I didn't form friendships with my coworkers and I've been unhappy at places where I made some great friends.
  • I've learned to be honest with my manager. Not too honest, but honest enough where I can
@atwayne
atwayne / Triangle.c
Created November 21, 2020 07:59
an example program to check type of triangle
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
// check sideToCheck
int checkSide(int firstSide, int secondSide, int sideToCheck)
{
if (sideToCheck > firstSide + secondSide)
{
return 0;
@atwayne
atwayne / code.md
Last active July 29, 2020 16:33
上海电信 IPTV 红外遥控器编码 HEX

电视机按键区域

  • 电源 14
  • 学习 N/A
  • 音量+ 8D724FB0
  • 音量- 8D72CF30
  • TV/IPTV 8D722FD0

IPTV按键区域

@atwayne
atwayne / index.html
Created July 28, 2020 16:44
Mocha Unit Test Template
<div id="mocha"></div>
<hr />
<div id="counterTest"></div>
@atwayne
atwayne / ad-blocker-douban-fm.user.js
Created June 11, 2020 07:05
tampermonkey user script for douban.fm
// ==UserScript==
// @name ad blocker for fm.douban.com
// @namespace http://tampermonkey.net/
// @version 0.1
// @author Wayne
// @match https://fm.douban.com/*
// @match https://douban.fm/*
// @grant none
// ==/UserScript==
@atwayne
atwayne / LazyMan.js
Last active September 14, 2016 06:46
function LazyMan(name) {
return new _LazyMan(name);
}
function _LazyMan(name) {
var self = this;
self.name = name;
self.tasks = [];
var greeting = function() {