Skip to content

Instantly share code, notes, and snippets.

Avatar

Pawit Pornkitprasan pawitp

View GitHub Profile
@pawitp
pawitp / super_num.patch
Created Dec 21, 2019
Patch to bring back Super+<Num> shortcut on Linux Mint 19.3. This is a partial revert of https://github.com/linuxmint/cinnamon/commit/94719c2cf1525f17b38bc7356d46d5b6bb5eab59
View super_num.patch
diff -ruw grouped-window-list@cinnamon.org.bak/appGroup.js grouped-window-list@cinnamon.org/appGroup.js
--- grouped-window-list@cinnamon.org.bak/appGroup.js 2019-12-12 18:46:55.000000000 +0700
+++ grouped-window-list@cinnamon.org/appGroup.js 2019-12-21 09:10:38.809467280 +0700
@@ -780,6 +780,33 @@
return false;
}
+ onAppKeyPress() {
+ if (this.groupState.isFavoriteApp && this.groupState.metaWindows.length === 0) {
+ this.launchNewInstance();
@pawitp
pawitp / gist:666208230ef8cd63d426dd80afbf0cc2
Last active Jun 22, 2019
Setup keyboard on Arch. Map <Win>+Left to Home, etc.
View gist:666208230ef8cd63d426dd80afbf0cc2
# This will map:
# <Win> + Left to Home
# <Win> + Right to End
# <Win> + Up to Page Up
# <Win> + Down to Page Down
# Modify /usr/share/X11/xkb/symbols/pc, replace the definition of <LEFT>, <RGHT>, <UP> and <DOWN>
key <LEFT> {
type[Group1]= "PC_SUPER_LEVEL2",
symbols[Group1]= [ Left, Home ]
@pawitp
pawitp / bitbucket_ci.php
Created Mar 17, 2016
Poor man's CI with bitbucket
View bitbucket_ci.php
<?php
error_reporting(E_ALL | ~E_NOTICE);
// Config
$url = "https://bitbucket.org/USERNAME/PROJECT/get/master.zip";
$user = "USERNAME";
$pass = "PASSWORD";
$tempfile = "thinkbox-ci.zip";
$target = "./";
$access_key = "ACCESS_KEY";
@pawitp
pawitp / -
Last active Nov 8, 2016
repo forall -cp git log --oneline android-6.0.1_r8..android-6.0.1_r11
View -
project build/
1bd2527 "MMB29Q"
7692803 Update Security String to 2016-02-01
project frameworks/av/
7b461b5 Fix security vulnerability in ICrypto DO NOT MERGE
0681b53 libstagefright: check requested memory size before allocation for SoftMPEG4Encoder and SoftVPXEncoder.
project frameworks/base/
View android-6.0.1_r3-to-android-6.0.1_r8.txt
project build/
4f09dc3 MMN29P
e8856b3 "MMB29O"
cfcece8 Update Security String to 2016-01-01 to mnc-dev
a625957 Revert "Change version back to 6.0"
06581f3 Change version back to 6.0
27fdf2c MMB29N
project external/bouncycastle/
View android-6.0.0_r26-to-android-6.0.1_r3.txt
project art/
7f57e8c [WIP] ART: Write-protect TLS
54d8f4b Fix in reference type propagation
ddb2a98 Parse runtime compiler options for JIT
f015c2f ART: Add missing GetInterfaceMethodIfProxy
2602aa8 ART: Decrease dex2oat watchdog timeout
22e0ce3 DO NOT MERGE Add locking to prevent races between setting class methods and marking
2a19678 ART: Do not abort on exception in CreatePeer
cc07760 ART: Clean up less in dex2oat
@pawitp
pawitp / memcached-$USER
Created Nov 28, 2015
CentOS's memcached init script, modified to support running socket-based user-specific instance
View memcached-$USER
#! /bin/sh
#
# chkconfig: - 55 45
# description: The memcached daemon is a network memory cache service.
# processname: memcached
# pidfile: /var/run/memcached-$USER/memcached.pid
# Standard LSB functions
#. /lib/lsb/init-functions
@pawitp
pawitp / bootable_recovery.patch
Last active Feb 22, 2016
Compatibility patches for I9082 on cm-12.1
View bootable_recovery.patch
From be936303368c68a2c6e096c0c56288fdba13779a Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Tue, 27 Jan 2015 22:29:39 +0700
Subject: [PATCH] recovery: uncrypt: fix compatibility with CWM
CWM and other older recoveries do not support block map, so avoid
using it when possible
Change-Id: I49a04676ca5193db31c87418a5760727648745f0
---
View -
E/AndroidRuntime( 2931): FATAL EXCEPTION: main
E/AndroidRuntime( 2931): Process: com.android.mms, PID: 2931
E/AndroidRuntime( 2931): java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ImageView.setOnClickListener(android.view.View$OnClickListener)' on a null object reference
E/AndroidRuntime( 2931): at com.android.ex.chips.DropdownChipLayouter$ViewHolder.<init>(DropdownChipLayouter.java:519)
E/AndroidRuntime( 2931): at com.android.ex.chips.DropdownChipLayouter.bindView(DropdownChipLayouter.java:238)
E/AndroidRuntime( 2931): at com.android.ex.chips.DropdownChipLayouter.bindView(DropdownChipLayouter.java:221)
E/AndroidRuntime( 2931): at com.android.ex.chips.BaseRecipientAdapter.getView(BaseRecipientAdapter.java:1044)
E/AndroidRuntime( 2931): at android.widget.AbsListView.obtainView(AbsListView.java:2346)
E/AndroidRuntime( 2931): at android.widget.ListPopupWindow$DropDownListView.obtainView(ListPopupWindow.java:1684)
E/AndroidRuntime( 2931): at android.widget.ListView.me
View foo.py
def formatBytes(val):
if val >= 1000000000:
return "%0.3f Gb" % (val / 1000000000)
elif val >=1000000:
return "%0.3f Mb" % (val / 1000000)
elif val >=1000:
return "%0.3f Kb" % (val / 1000)
else:
return "%0.3f B" % val
You can’t perform that action at this time.