This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| kill_by_port{ | |
| lsof -i ":${1}" | awk 'NR > 1 {print $2}' | xargs kill -9 | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| System version | Expected number of burnt fuses (retail) | Expected number of burnt fuses (non-retail) | |
|---|---|---|---|
| 1.0.0 | 1 | 0 | |
| 2.0.0-2.3.0 | 2 | 0 | |
| 3.0.0 | 3 | 1 | |
| 3.0.1-3.0.2 | 4 | 1 | |
| 4.0.0-4.1.0 | 5 | 1 | |
| 5.0.0-5.1.0 | 6 | 1 | |
| 6.0.0-6.1.0 | 7 | 1 | |
| 6.2.0 | 8 | 1 | |
| 7.0.0-8.0.1 | 9 | 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(document).ready(function() { | |
| $("#about").click(function() { | |
| $('#about > .lazyload').each(function() { | |
| // set the img src from data-src | |
| $(this).attr('src', $(this).attr('data-src')); | |
| }); | |
| }); | |
| $("#articles").click(function() { | |
| $('#articles > .lazyload').each(function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| listen 443 ssl http2; | |
| server_name jonlu.ca www.jonlu.ca; | |
| root /var/www/html; | |
| index index.html index.htm; | |
| location ~ /.git/ { | |
| deny all; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| worker_processes auto; | |
| pid /run/nginx.pid; | |
| worker_rlimit_nofile 30000; | |
| events { | |
| worker_connections 65535; | |
| multi_accept on; | |
| use epoll; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); | |
| const ZopfliPlugin = require("zopfli-webpack-plugin"); | |
| module.exports = { | |
| entry: './js/app.js', | |
| mode: 'production', | |
| output: { | |
| path: __dirname + '/dist', | |
| filename: 'bundle.js' | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| listen 443 ssl http2; | |
| listen [::]:443 ssl http2; | |
| server_name jonlu.ca www.jonlu.ca; | |
| root /var/www/html; | |
| index index.html index.htm; | |
| location ~ /.git { | |
| deny all; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server{ | |
| listen 80; | |
| server_name jonlu.ca www.jonlu.ca; | |
| root /var/www/html; | |
| index index.html index.htm; | |
| location ~ /.git/ { | |
| deny all; | |
| } | |
| location ~ / { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #define MAX_SET_TO_ONE 1000 | |
| int mVar = 0; | |
| int mTimesSetToOne = 0; | |
| void setVarToOne(int* mVar){ | |
| if(mVar && mTimesSetToOne < MAX_SET_TO_ONE){ | |
| *mVar = 1; | |
| mTimesSetToOne++; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int mVar = INT_MAX; | |
| void setVarToOne(int* mVar){ | |
| if(mVar) *mVar = 1; | |
| } | |
| setVarToOne(&mVar); | |
| ASSERTEQ(mVar,1); //true |