Skip to content

Instantly share code, notes, and snippets.

View julianlam's full-sized avatar
🤔
I may be slow to respond.

Julian Lam julianlam

🤔
I may be slow to respond.
View GitHub Profile
@julianlam
julianlam / gist:a4e9c4c9458e0ccdd459
Created October 20, 2014 14:29
[nodebb-script-ajaxify-disable] Disable the Single Page Application aspect of NodeBB
<script>
ajaxify.go = function(url) {
window.location.href = RELATIVE_PATH + '/' + url;
};
</script>
diff --git a/src/upgrade.js b/src/upgrade.js
index 117b798..4001ffe 100644
--- a/src/upgrade.js
+++ b/src/upgrade.js
@@ -593,6 +593,7 @@ Upgrade.upgrade = function(callback) {
}
},
function(next) {
+ return next();
thisSchemaDate = Date.UTC(2015, 0, 14);
@julianlam
julianlam / gist:ee7c1084a6faba5fa398
Created July 9, 2015 16:10
Handy Dandy SSL Commands
### Create and Store a CSR
cd /etc/ssl
mkdir -p localcerts/sitename
cd localcerts/sitename
openssl req -new -newkey rsa:2048 -nodes -sha256 -days 365 -keyout sitename.key -out sitename.csr
chmod 400 sitename.csr sitename.key
@julianlam
julianlam / chinese_convert.js
Last active January 20, 2016 19:10
Converting Simplified Chinese to Traditional Chinese in NodeBB
var defaultEncoding = 1; // é è¨­èªžè¨€ï¼š1-繁體中文 | 2-简体中文
var translateDelay = 0;
var cookieDomain = "http://yoursite"; // ä¿®æ”¹çˆ²ä½ çš„éƒ¨è½æ ¼åœ°å€
var msgToTraditionalChinese = "轉換爲繁體"; // 簡轉繁時所顯示的文字
var msgToSimplifiedChinese = "转换为简体"; // 繁转简时所显示的文字
var translateButtonId = "translateLink"; // 「轉換」<A>鏈接標籤ID
var currentEncoding = defaultEncoding;
var targetEncodingCookie = "targetEncoding" + cookieDomain.replace(/\./g,"");
var targetEncoding = ( getCookie(targetEncodingCookie) == null ? defaultEncoding : getCookie(targetEncodingCookie) );
@julianlam
julianlam / dbdive.js
Created March 8, 2016 16:32
One-off db diving script
'use strict';
/*globals require, console, process */
var nconf = require('nconf');
var async = require('async');
var fs = require('fs');
nconf.file({
file: 'config.json'
});
@julianlam
julianlam / gist:3a2d0bd6720ac2f45bef
Created September 3, 2014 18:02
Allowing NodeBB to serve all static assets
server {
listen 80;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_redirect off;
# Socket.IO Support
@julianlam
julianlam / gist:5110542203d04da69ba4e862827796da
Last active October 29, 2017 13:02
/r/TheOrville CSS changes
/* Generic arrow styles for all updoot and downdoot buttons */
.arrow {
width: 0px;
height: 0px;
}
/* Rectangle below updoot */
.commentarea .arrow.upmod::after, .arrow.up::after {
position: relative;
top: 0.7rem;
Computer Information:
Manufacturer: Unknown
Model: Unknown
Form Factor: Laptop
No Touch Input Detected
Processor Information:
CPU Vendor: GenuineIntel
CPU Brand: Intel(R) Core(TM) i7-10710U CPU @ 1.10GHz
CPU Family: 0x6
@julianlam
julianlam / spa112-registration-failure.md
Last active September 17, 2021 15:16
Fixing a SPA112 registration failure (Tomato/SPA112/VoIP.ms) #blog

Since replacing my router with an Asus RT-AC68U1, I ran into an odd issue where my VoIP phone no longer registered with my provider VoIP.ms1.

I didn't clue in immediately that it was due to the router (and firmware) change, and I was about to reach out to the support team but decided to check their FAQ2 as it was suggested I do so prior to starting the live chat session.

As it turns out, there is an incompatibility with the Tomato firmware and the Linksys/Cisco SPA1121 I use.

To resolve,

  1. Navigate to your Tomato router at http://192.168.1.1 and log in.
  2. Navigate to Advanced > Conntrack/Netfilter
@julianlam
julianlam / meta.json
Last active September 18, 2021 04:14
A decade in the industry; a ten year retrospective #blog
{
"timestamp": "1597527540000"
}