Skip to content

Instantly share code, notes, and snippets.

View 7imbrook's full-sized avatar
Over Caffinated

Michael Timbrook 7imbrook

Over Caffinated
View GitHub Profile
import { defer, interval, Observable } from 'rxjs';
import { finalize, takeUntil } from 'rxjs/operators';
import * as vscode from 'vscode';
/**
* Gets an observable that emits once and completes when vscode starts shutting down
* @param context vscode context to add the shutdown disposable to
*/
function addShutdownObserver({subscriptions}: vscode.ExtensionContext): Observable<void> {
return new Observable((s) => {
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: repro
spec:
serviceName: "repro"
replicas: 1
selector:
matchLabels:
app: repro
PORTB = $6000
PORTA = $6001
DDRB = $6002
DDRA = $6003
PCR = $600C
; LCD pins
E = %10000000
RW = %01000000
RS = %00100000
@7imbrook
7imbrook / why.py
Created July 24, 2016 07:29
Just why?
with ...:
for ...:
if ...:
try:
variable = assignment
# The fact that I can do this angers me
print(variable)
@7imbrook
7imbrook / README.md
Last active August 29, 2015 14:27 — forked from dansimau/README.md
Enable git-style colour output in regular diff on Mac OS X

Enable git-style colour output in regular diff

Mac OS X

  1. Install colordiff using Homebrew:

     brew install colordiff
    
  2. Add function to your ~/.bash_profile:

@7imbrook
7imbrook / hex.m
Created March 28, 2015 18:04
Macro for hex value color? Maybe haven't tested.
#define withHexCode hex colorWithRed:(hex >> 32) green:((hex & 0x00FF00) >> 16) blue:(hex & 0x00000FF)
[UIColor withHexCode(0xeccecc)];
[UIColor withHexCode(0xeccecc) alpha:1.0];
@7imbrook
7imbrook / designer.html
Created August 28, 2014 20:18
designer
<link rel="import" href="../components/polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
@7imbrook
7imbrook / designer.html
Created August 28, 2014 19:47
designer
<link rel="import" href="../topeka-elements/category-icons.html">
<link rel="import" href="../core-icon/core-icon.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
@7imbrook
7imbrook / rexMagic.swift
Created August 20, 2014 01:47
This is awesome
import Foundation
// Simple Regex wrapper for simplicity
struct Regex {
let pattern: String
let options: NSRegularExpressionOptions!
private var matcher: NSRegularExpression {
return NSRegularExpression(pattern: self.pattern, options: self.options, error: nil)
}
@7imbrook
7imbrook / twitter.m
Created April 26, 2014 15:01
Get Twitter Timeline
/**
* Loads the default users timeline into the timeline view
*/
- (void)loadTimeline
{
// Get first Twitter account on device
ACAccountStore *store = [ACAccountStore new];
ACAccountType *typeTwitter = [store accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];
// Request access to account information