Skip to content

Instantly share code, notes, and snippets.

View idiotandrobot's full-sized avatar

Michael Phillips idiotandrobot

View GitHub Profile
@idiotandrobot
idiotandrobot / background.c
Last active January 3, 2016 15:41
Pebble C
static BitmapLayer *s_background_layer;
static GBitmap *s_background_bitmap;
static void configure_background(Layer *window_layer, GRect bounds) {
s_background_bitmap = gbitmap_create_with_resource(RESOURCE_ID_IMAGE_BACKGROUND);
s_background_layer = bitmap_layer_create(bounds);
bitmap_layer_set_bitmap(s_background_layer, s_background_bitmap);
@idiotandrobot
idiotandrobot / index.html
Created January 13, 2016 17:43
InR-Time Configuration Page
<!DOCTYPE html>
<html>
<head>
<title>Slate Example Configuration</title>
<link rel='stylesheet' type='text/css' href='css/slate.min.css'>
<script src='js/slate.min.js'></script>
<style>
.title {
padding: 15px 10px;
text-transform: uppercase;
@idiotandrobot
idiotandrobot / EmailDocument.Office-2016.vba
Last active March 6, 2018 03:20
Office 2016 document emailing macro
Sub EmailDocument()
'On Error Resume Next
If Len(ActiveDocument.Path) = 0 Then
ActiveDocument.Save
End If
Dim RanOutlook As Boolean
Dim Outlook As Object 'Outlook.Application throws "Compile error: User-defined type not defined"
@idiotandrobot
idiotandrobot / EmailDocument.vba
Created February 1, 2016 12:34
Pre-Office 2016 document emailing macro
Sub EmailDocument()
On Error Resume Next
If Len(ActiveDocument.Path) = 0 Then
ActiveDocument.Save
End If
Dim RanOutlook As Boolean
Dim Outlook As Outlook.Application
@idiotandrobot
idiotandrobot / OneDrive.cs
Last active May 1, 2022 14:50
OneDrive Windows Folder Path
public static class OneDrive
{
private static string _Path;
public static string Path => _Path ??= GetPath();
static string GetPath() => Environment.GetEnvironmentVariable("OneDriveConsumer");
}
@idiotandrobot
idiotandrobot / Dropbox.cs
Last active April 19, 2016 09:43
Dropbox Windows Folder path
using Newtonsoft.Json.Linq;
using System;
using System.IO;
public static class Dropbox
{
private static string _Path;
public static string Path
{
get { return _Path ?? (_Path = GetPath()); }
[DllImport("user32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool AddClipboardFormatListener(IntPtr hwnd);
[DllImport("user32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool RemoveClipboardFormatListener(IntPtr hwnd);
private const int WM_CLIPBOARDUPDATE = 0x031D;
sudo apt-get update
sudo apt-get install ruby-full
sudo gem install jekyll
sudo gem install jekyll-sitemap
sudo gem install jekyll-redirect-from
sudo apt-get purge nodejs -y
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 68576280
sudo apt-add-repository "deb https://deb.nodesource.com/node_4.x precise main"
sudo apt-get update
sudo apt-get install nodejs
@idiotandrobot
idiotandrobot / raspi-vscode.sh
Last active November 12, 2016 22:41
Compiling Visual Studio Code on a Raspberry Pi
wget http://node-arm.herokuapp.com/node_latest_armhf.deb
sudo dpkg -i node_latest_armhf.deb
sudo apt-get install libx11-dev
git clone https://github.com/microsoft/vscode
cd vscode
git checkout 1.0.0
./scripts/npm.sh install --arch=armhf