Skip to content

Instantly share code, notes, and snippets.

View jonluca's full-sized avatar

JonLuca De Caro jonluca

View GitHub Profile
@jonluca
jonluca / webpack.config.js
Last active March 20, 2018 02:09
Webpack Config
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'
},
@jonluca
jonluca / lazyload.js
Last active March 23, 2018 01:28
Lazy Load
$(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() {
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;
@jonluca
jonluca / nginx.conf
Last active April 6, 2018 06:48
Nginx Conf
worker_processes auto;
pid /run/nginx.pid;
worker_rlimit_nofile 30000;
events {
worker_connections 65535;
multi_accept on;
use epoll;
}
@jonluca
jonluca / functions.zsh
Created September 11, 2018 17:11
Bash/Zsh Kill Port
kill_by_port{
lsof -i ":${1}" | awk 'NR > 1 {print $2}' | xargs kill -9
}
@jonluca
jonluca / functions.zsh
Last active September 11, 2018 17:13
Bash/Zsh Kill Port
kill_by_port(){
lsof -i ":${1}" | awk 'NR > 1 {print $2}' | xargs kill -9
}
@jonluca
jonluca / gist:0c8477e2a6194b5adb23fc45e71b8c1a
Created December 22, 2018 13:49
sudo dapptrace -ac ifconfig en0 ether ce:a1:fc:be:ac:a1 > functrace.txt 2>&1
This file has been truncated, but you can view the full file.
PID/THRD RELATIVE ELAPSD CPU CALL(args) = return
40994/0x24b5f4: 1093 . . -> dyld:mach_msg_destroy(0x7FFEE2BE0970, 0x3, 0xA80)
40994/0x24b5f4: 1095 . . -> dyld:mach_msg_destroy_port(0x0, 0x0, 0xA80)
40994/0x24b5f4: 1096 . . -> dyld:mach_msg_destroy_port(0x0, 0x0, 0xA80)
40994/0x24b5f4: 1099 . . -> dyld:mach_port_destruct(0x203, 0x807, 0x0)
40994/0x24b5f4: 1100 . . -> dyld:_kernelrpc_mach_port_destruct_trap(0x203, 0x807, 0x0)
40994/0x24b5f4: 1108 19 7 <- dyld:_kernelrpc_mach_port_destruct_trap = 10
40994/0x24b5f4: 1110 54 10 <- dyld:mach_port_destruct = 66
40994/0x24b5f4: 1124 . . -> libdyld.dylib:tlv_initializer(0x203, 0x807, 0x0)
40994/0x24b5f4: 1131 . . -> libsystem_pthread.dylib:pthread_key_create(0x7FFF9DF13FF0, 0x7FFF6B138BA2, 0x0)
@jonluca
jonluca / sudo dtruss -afs -W ifconfig > ifconfig.out 2>&1
Created December 22, 2018 13:51
sudo dtruss -afs -W ifconfig > ifconfig.out 2>&1 - all syscalls made when changing mac addresses
Waiting for ifconfig, hit Ctrl-C to stop waiting...
PID/THRD RELATIVE ELAPSD CPU SYSCALL(args) = return
38782/0x244665: 701 54 0 thread_selfid(0x0, 0x0, 0x0) = 2377317 0
dyld`__thread_selfid+0xa
dyld`mach_init+0x13
dyld`dyldbootstrap::start(macho_header const*, int, char const**, long, macho_header const*, unsigned long*)+0x432
dyld`_dyld_start+0x36
ifconfig`0x4
@jonluca
jonluca / ioreg -r -n ARPT > ioreg.txt
Created December 22, 2018 13:53
ioreg outpt for ARPT
+-o ARPT@0 <class IOPCIDevice, id 0x10000037e, registered, matched, active, busy 0 (18308 ms), retain 17>
| {
| "IOInterruptControllers" = ("io-apic-0","IOPCIMessagedInterruptController")
| "built-in" = <00>
| "wlan.tx.ring.size" = 512
| "bcom.oscar.profilestates" = <0000000200200022090d0000>
| "bcom.roam.profiles" = <0c00f6ffb5ff0200b80bb4000200b0041400bfff32001000b5ff80ff02005a001e0001001e000c00bfff3200000000000000000000000000000000000000000000001000b5ff80ff02005a001e0001001e000c0080ff0a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001400b5ff80ff02005a001e000200b4000c00bfff320000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001400b5ff80ff02005a001e000200b4000c0080ff0a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00f6ffb5ff0200b80bb4000200b0041400bfff32001000b5ff80ff02005a001e000200b4000c00bfff3200000000000000000000000000000000000000000000001000b5ff80ff02005a001
@jonluca
jonluca / system report
Created December 22, 2018 13:55
System report 2018mbp
Software Versions:
CoreWLAN: 13.0 (1370.8)
CoreWLANKit: 13.0 (1370.8)
Menu Extra: 13.0 (1376.2)
System Information: 12.0 (1300.2)
IO80211 Family: 12.0 (1200.12.2)
Diagnostics: 1.0 (805)
AirPort Utility: 6.3.9 (639.7)
Interfaces:
en0: