Skip to content

Instantly share code, notes, and snippets.

View antdking's full-sized avatar

Anthony King antdking

View GitHub Profile
if [[ "$rom" == "carbon" ]]; then
if [[ "$log" == "y" ]]; then
echo "mka carbon 2>&1 | tee ../build-logs/$device-$rom-build-$(date +%m.%d-%H_%M_%S)"
mka carbon 2>&1 | tee ../build-logs/$device-$rom-build-$(date +%m.%d-%H_%M_%S)
else
echo "mka carbon"
mka carbon
fi
else
if [[ "$log" == "y" ]]; then
parse_remotes () {
if [[ $tag_name = "remote" ]] ; then
eval local $attributes 2>/dev/null #ignore the warnings
if [[ $fetch == ".." ]]; then
echo "the base url of the projects is required"
read -p "[https://github.com/] " fetch
if [[ ! $fetch ]]; then
# TODO: in past experience, users are unreliable. find a way to do this better!
fetch="https://github.com/"
fi
@antdking
antdking / gist:6045613
Created July 20, 2013 16:22
a simple log in system
import hashlib
import getpass
def login_user():
n = 0
while not n == 3: # give them 3 attempts at this
u = raw_input('enter username: ')
if u == "":
print "please enter a username"
[FLOATLEFT][CODE]
[COLOR="Blue"]from[/COLOR] xda [COLOR="blue"]import[/COLOR] private_Message [COLOR="Blue"]as[/COLOR] PM
[COLOR="Red"]if[/COLOR] "[COLOR="YellowGreen"]help[/COLOR]" [COLOR="red"]in[/COLOR] PM.subject [COLOR="red"]or[/COLOR] "[COLOR="YellowGreen"]help[/COLOR]" [COLOR="red"]in[/COLOR] PM.content [COLOR="Red"]or[/COLOR] [COLOR="Cyan"]\[/COLOR]
PM.filter[COLOR="cyan"]([/COLOR][COLOR="MediumTurquoise"]r[/COLOR]'[COLOR="YellowGreen"](rom)|(device) request[/COLOR]'[COLOR="cyan"]):[/COLOR]
PM.manage.folder[COLOR="cyan"]([/COLOR]PM.spam[COLOR="cyan"])[/COLOR]
PM.ignore[COLOR="cyan"]([/COLOR]PM.sender.user[COLOR="cyan"])[/COLOR]
PM.reply[COLOR="cyan"]([/COLOR]"[COLOR="YellowGreen"]I do not run a support service via my pm[/COLOR]"[COLOR="cyan"])[/COLOR]
[COLOR="Red"]if[/COLOR] PM.sender.class [COLOR="Red"]==[/COLOR] PM.class.noob[COLOR="cyan"]:[/COLOR]
PM.reply[COLOR="cyan"]([/COLOR]"[URL="http://www.youtube.com/watch?v=JmvCpR45LKA"]http://www.youtube.com/watch?v=JmvCpR45LKA[/URL]"[COL
hb_upload() {
content="$*"
key=$(curl -sd post_data="${content}" "http://hastebin.com/documents" | sed 's/{\|}\|\"\|:\|\(key\)//g')
echo "${key}"
}
hb_raw() {
content="$*"
key=$(hb_upload "${content}")
echo "http://hastebin.com/raw/${key}"
#!/usr/bin/env python
'''
Front end for displaying the definitions on screen, and to forward
the words to the spellChecker function to return a value of 0, 1 or 2
This is just an example to use the spellChecker, it will not be used
in the final product
'''
# Copyright (C) 2013 Cybojenix
# This may not be distirubuted or modified without concent from the author
__AUTHOR__ = "Cybojenix"
__COPYRIGHT__ = "Cybojenix"
__LICENSE__ = "None"
from watchdog.observers import Observer
from watchdog.tricks import Trick
from re import sub
@antdking
antdking / BoardConfig.mk
Created July 14, 2014 12:38
for boot image building
BOARD_KERNEL_SEPARATED_DT := true
BOARD_CUSTOM_BOOTIMG_MK := device/motorola/condor/mkbootimg.mk
TARGET_KERNEL_SOURCE := kernel/motorola/msm8610
TARGET_KERNEL_CONFIG := msm8610_defconfig
BOARD_KERNEL_BASE := 0x00000000
BOARD_KERNEL_PAGESIZE := 2048
BOARD_KERNEL_CMDLINE := console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 utags.blkdev=/dev/block/platform/msm_sdcc.1/by-name/utags vmalloc=400M
BOARD_MKBOOTIMG_ARGS := --ramdisk_offset 0x01000000 --tags_offset 0x00000100
from urllib import urlretrieve
import xml.etree.ElementTree as ET
import json
urlretrieve("http://otaslim.slimroms.net/ota.xml", "ota.xml")
root = ET.parse('ota.xml').getroot()
stable = root.find('Stable')
data = {}
for device in stable:
@antdking
antdking / designer.html
Last active August 29, 2015 14:05
designer
<link rel="import" href="../google-map/google-map.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;