Skip to content

Instantly share code, notes, and snippets.

View devisnotnull's full-sized avatar
🎯
Focusing

Alex Brown @lextech devisnotnull

🎯
Focusing
View GitHub Profile
@devisnotnull
devisnotnull / msys_hetzner-etc_network_interfaces
Created November 11, 2016 19:15 — forked from jpawlowski/msys_hetzner-etc_network_interfaces
Debian network configuration for Proxmox VE server running on a Hetzner host
# /etc/network/interfaces
#
auto lo
iface lo inet loopback
# device: eth0
iface eth0 inet manual
# IPv4 bridge
# (connect ONLY your firewall/router KVM instance here, this is the WAN device!)
@devisnotnull
devisnotnull / _guards.ts
Created October 7, 2016 17:56
Adding guards to Angular 2 routes
import { Router, CanActivate } from '@angular/router';
import { Injectable } from '@angular/core';
/** **/
class UserToken {}
/** **/
class Permissions {
canActivate(user: UserToken, id: string): boolean {
return true;
}
@devisnotnull
devisnotnull / introrx.md
Created October 7, 2016 01:11 — forked from secdata/introrx.md
The introduction to Reactive Programming you've been missing
@devisnotnull
devisnotnull / gist:ab2c806bc26734945abe28d724c62b5c
Created September 29, 2016 20:07
Python, XML-to-DICT. Really simple yet effective
def etree_to_dict(t):
"""
A simple yet really powerful function for converting XML into a dict,
Faster than xmltodict
http://www.xml.com/pub/a/2006/05/31/converting-between-xml-and-json.html
:param t:
:return:
"""
d = {
t.tag: {} if t.attrib else None
@devisnotnull
devisnotnull / mongodb-objectid-type-adapter-GSON.java
Last active January 7, 2019 22:31
MongoDB ObjectID Gson TypeAdapter
import java.io.IOException;
import java.lang.reflect.Type;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import org.bson.types.ObjectId;
import com.google.gson.*;
/**
* Created by alexb on 12/05/15.
git add *
git commnit -m "Message"
git push origin master
--Simple git commands once origin already established
@devisnotnull
devisnotnull / gist:5292672
Created April 2, 2013 14:32
List Of All Podcast Categories
- Arts:
- Design
- Fashion & Beauty
- Food
- Literature
- Performing Arts
- Spoken Word
- Visual Arts
- Business:
- Business News