Skip to content

Instantly share code, notes, and snippets.

View er1z's full-sized avatar

Przemysław eRIZ Pawliczuk er1z

View GitHub Profile
@er1z
er1z / rules.sh
Created December 13, 2017 22:55
Raspberry and 2x Xiaomi Yi Dash Cam
#!/bin/sh
iptables -A PREROUTING -d 192.168.1.11 -t mangle -j MARK --set-mark 1
iptables -A PREROUTING -d 192.168.1.22 -t mangle -j MARK --set-mark 2
ip rule add fwmark 1 table 1
ip rule add fwmark 2 table 2
ip route add default via 192.168.1.11 table 1
ip route add default via 192.168.1.22 table 2
@er1z
er1z / services.yml
Created September 22, 2015 11:12
service with callback
service:
class: A\B\C
calls:
- [setRequestStack, [@request_stack]]
var resolver = function(module, obj, dependencies){
if(typeof exports == 'Object'){
var objects = [];
for(var d in dependencies){
objects.push = require(d);
}
exports[module] = obj.apply(null, objects);
}else{
@er1z
er1z / gist:7721573
Last active February 11, 2024 22:33
if ( typeof module === "object" && module && typeof module.exports === "object" ) {
// Expose jQuery as module.exports in loaders that implement the Node
// module pattern (including browserify). Do not create the global, since
// the user will be storing it themselves locally, and globals are frowned
// upon in the Node module world.
module.exports = jQuery;
} else {
// Otherwise expose jQuery to the global object as usual
window.jQuery = window.$ = jQuery;