Skip to content

Instantly share code, notes, and snippets.

View bmc08gt's full-sized avatar

Brandon McAnsh bmc08gt

View GitHub Profile
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl -L https://npmjs.org/install.sh | sh
mkdir ~/.nave
cd ~/.nave
wget http://github.com/isaacs/nave/raw/master/nave.sh
sudo ln -s $PWD/nave.sh /usr/local/bin/nave
nave usemain stable
public static class StorageInfo {
public final String path;
public final boolean readonly;
public final boolean removable;
public final int number;
StorageInfo(String path, boolean readonly, boolean removable, int number) {
this.path = path;
this.readonly = readonly;
public String getBestResolution() {
String[] resolutions = null;
String resolution = "720p";
String rawList = readSupportList(HDMI_SUPPORT_LIST);
if (rawList != null) {
resolutions = (rawList.substring(0, rawList.length()-1)).split("|");
}
if (resolutions != null) {
for (int i = 0; i < resolutions.size(); i++) {
if (resolutions[i].contains("*")) {
@bmc08gt
bmc08gt / designer.html
Created August 18, 2014 20:02
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
@bmc08gt
bmc08gt / kernelpanic
Created November 13, 2014 20:29
ghost cm-12.0 panic
[ 0.192003,1] Switching to clocksource gp_timer
[ 0.238943,1] Unable to handle kernel paging request at virtual address ffffffff
[ 0.239127,1] pgd = c0004000
[ 0.239401,1] [ffffffff] *pgd=b77fd821, *pte=00000000, *ppte=00000000
[ 0.240012,1] Internal error: Oops: 17 [#1] PREEMPT SMP ARM
[ 0.240286,1] Modules linked in:
[ 0.240592,1] CPU: 1 Tainted: G W (3.4.42-g7f702bf #2)
[ 0.240897,1] PC is at kmem_cache_alloc_trace+0x68/0x1b4
[ 0.241049,1] LR is at con_insert_unipair+0xa0/0xec
[ 0.241355,1] pc : [<c0124264>] lr : [<c02fa0c0>] psr: a0000013
@bmc08gt
bmc08gt / repopick-cm12
Last active August 29, 2015 14:09
Current CM12 open commits being used
source build/envsetup.sh
repopick 77128 # Switch to new Superuser
repopick 78202 # Change color to match Lollipop Style
repopick 77097 # Allow a device to define the max number of service groups in init.h
# device changes
cd device/motorola/ghost
git fetch http://review.cyanogenmod.org/CyanogenMod/android_device_motorola_ghost refs/changes/14/77814/4 && git cherry-pick FETCH_HEAD
git fetch http://review.cyanogenmod.org/CyanogenMod/android_device_motorola_ghost refs/changes/29/77829/4 && git cherry-pick FETCH_HEAD
@bmc08gt
bmc08gt / gist:509906b4c3d6fbd9fc42
Created March 20, 2015 16:19
extract-files.sh for arm-64 lollipop devices
#!/bin/bash
#
# Copyright (C) 2013, 2015 The CyanogenMod Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@bmc08gt
bmc08gt / MailForm
Created December 10, 2013 02:14
Simple Mail SmtpServer Form
Imports System.Net.Mail
Public Class MailForm
' Email contents
Dim toEmail, subject, textBody As String
' Email credentials
Dim fromEmail, password As String
Private Sub SendButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles SendButton.Click
toEmail = toEmailTextBox.Text
@bmc08gt
bmc08gt / make_aokp_env.sh
Last active January 1, 2016 02:09
Android Open Kang Project Environment Setup Bash Script
#!/bin/bash
cd $HOME
echo "Which dir to repo init in? (~/aokp/<dir name>)"
read dir
sudo apt-get install git-core gnupg flex bison gperf build-essential zip \
curl libc6-dev libncurses5-dev:i386 x11proto-core-dev libx11-dev:i386 \
libreadline6-dev:i386 libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib \