Skip to content

Instantly share code, notes, and snippets.

View bmc08gt's full-sized avatar

Brandon McAnsh bmc08gt

View GitHub Profile
@bmc08gt
bmc08gt / ul_to_select.js
Created January 10, 2014 17:37
ul->selector in CSA Edit Page
// ==UserScript==
// @name ul->select
// Written by Brandon McAnsh (C) 2014
// @namespace localhost
// @include https://clientserviceadmin.com/Customer/Edit/*
// @version 1
// @grant none
// ==/UserScript==
$('.nav-list-boxed:nth-child(5)').each(function(){
var list=$(this),
@bmc08gt
bmc08gt / doTimeout.js
Created January 23, 2014 18:26
doTimeout plugin
//doTimeout plugin
(function($){var a={},c="doTimeout",d=Array.prototype.slice;$[c]=function(){return b.apply(window,[0].concat(d.call(arguments)))};$.fn[c]=function(){var f=d.call(arguments),e=b.apply(this,[c+f[0]].concat(f));return typeof f[0]==="number"||typeof f[1]==="number"?this:e};function b(l){var m=this,h,k={},g=l?$.fn:$,n=arguments,i=4,f=n[1],j=n[2],p=n[3];if(typeof f!=="string"){i--;f=l=0;j=n[1];p=n[2]}if(l){h=m.eq(0);h.data(l,k=h.data(l)||{})}else{if(f){k=a[f]||(a[f]={})}}k.id&&clearTimeout(k.id);delete k.id;function e(){if(l){h.removeData(l)}else{if(f){delete a[f]}}}function o(){k.id=setTimeout(function(){k.fn()},j)}if(p){k.fn=function(q){if(typeof p==="string"){p=g[p]}p.apply(m,d.call(n,i))===true&&!q?o():e()};o()}else{if(k.fn){j===undefined?e():k.fn(j===false);return true}else{e()}}}})(jQuery);
@bmc08gt
bmc08gt / 99fixgmsperms
Last active April 3, 2016 15:28
init.d script to workaround opengapps issue #200
#!/system/bin/sh
# Fix permission issues with OpenGApps and CM13/AOSP ROMs (issue #200 @github)
#
# Will check if permission is previously granted by the system before blanket granting
#
# Also will only run on first boot
#set -x
required_perms=(android.permission.ACCESS_FINE_LOCATION android.permission.ACCESS_COARSE_LOCATION)
$ git status
On branch cm-13.0
Your branch is up-to-date with 'origin/cm-13.0'.
Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: g5-common/proprietary/app/TimeService/TimeService.apk
modified: g5-common/proprietary/bin/adsprpcd
modified: g5-common/proprietary/bin/energy-awareness
01-01 21:39:49.254 691 696 E Sensors : sns_sam_mr.c(1107):Unable to acquire service handle 0
01-01 21:39:49.254 691 696 E Sensors : mag_cal.c(1609):mag_cal_sam_init: Unknown UUID(1) 00000000-0000-0000
01-01 21:39:49.254 691 696 E Sensors : mag_cal.c(1614):mag_cal_sam_init: Unknown UUID(2) 0000-000000000000
01-01 21:39:49.255 691 696 E Sensors : sns_sam.c(4463):Failed to register algorithm service 16 with SAM
01-01 21:39:59.260 691 691 E Sensors : sns_debug_mr.c(664):Sensors DIAG Init: Waiting for debug service timed out
01-01 21:39:59.260 691 691 E Sensors : sns_debug_main.c(882):Sensors DIAG init: Can't register with debug
01-01 21:39:59.260 691 691 E Sensors : sns_init_la.c(203):Error 5 initializing sns_debug_test_init2
01-01 21:39:59.260 691 691 E Sensors : sns_main.c(1738):Exiting! sensor1_init failed with 5
01-01 21:39:59.275 709 709 I libmdmdetect: ESOC framework not supported
01-01 21:39:59.275 709 709 I libmdmdetect: slpi subsystem located
.class public interface abstract Lcom/lge/internal/telephony/LgeRILConstants;
.super Ljava/lang/Object;
.source "LgeRILConstants.java"
# interfaces
.implements Lcom/android/internal/telephony/RILConstants;
# static fields
.field public static final INVALID_PARAMETER:I = 0x1c
[ 3.995755 / 01-01 02:09:32.039][0] modem is powering up
[ 3.997395 / 01-01 02:09:32.039][3] pil-q6v5-mss 2080000.qcom,mss: modem: loading from 0x0000000088800000 to 0x000000008e900000
[ 4.003634 / 01-01 02:09:32.049][1] init: Starting service 'ipacm'...
[ 4.007257 / 01-01 02:09:32.049][3] pil-q6v5-mss 2080000.qcom,mss: pil : mss reset and load mba
[ 4.061337 / 01-01 02:09:32.109][1] init: Starting service 'sensors'...
[ 4.062967 / 01-01 02:09:32.109][1] init: Service 'sensor-sh' (pid 554) exited with status 0
[ 4.085192 / 01-01 02:09:32.129][1] init: Starting service 'qti'...
[ 4.099296 / 01-01 02:09:32.139][3] pil-q6v5-mss 2080000.qcom,mss: Loading MBA and DP (if present) from 0x00000000f7f00000 to 0x00000000f8080000
[ 4.100781 / 01-01 02:09:32.149][1] init: service 'console' requires console
[ 4.102307 / 01-01 02:09:32.149][1] init: Service 'qcom-c_core-sh' (pid 550) exited with status 0
mba_mem: mba_region@2080000 {
+ linux,reserve-contiguous-region;
+ reg = <0 0x2080000 0 0x6100000>;
+ label = "mba_mem";
+ };
modem_mem: modem_region@88800000 {
compatible = "removed-dma-pool";
@bmc08gt
bmc08gt / StringUtil.java
Last active June 15, 2016 20:15
Pattern matching and apply exclusive typefaces
public static void boldPattern(TextView textView, String p) {
String text = (String) textView.getText();
Pattern pattern = Pattern.compile(p);
Matcher matcher = pattern.matcher(text);
final SpannableStringBuilder sb = new SpannableStringBuilder(text);
while (matcher.find()) {
final StyleSpan bss = new StyleSpan(Typeface.BOLD);
sb.setSpan(bss, matcher.start(), matcher.end(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
}
$ adb logcat -b radio
01-01 05:25:33.455 499 499 D RILD : **RIL Daemon Started**
01-01 05:25:33.456 499 499 D RILD : **RILd param count=1**
01-01 05:25:33.526 523 523 D RILD : **RIL Daemon Started**
01-01 05:25:33.526 523 523 D RILD : **RILd param count=3**
07-15 02:47:41.317 499 499 D RILD : RIL_Init argc = 3 clientId = 0
07-15 02:47:41.320 499 499 E RILQ : log to /data/misc/radio/ril_log for QCRIL logging is not enabled
07-15 02:47:41.324 523 523 D RILD : RIL_Init argc = 3 clientId = 2
07-15 02:47:41.324 523 523 E RILQ : log to /data/misc/radio/ril_log for QCRIL logging is not enabled
07-15 02:47:41.414 523 523 E RILQ : (1/523): RIL[1][rild] RIL_Init: Usupported configuration, can't determine sim slot