Skip to content

Instantly share code, notes, and snippets.

View paour's full-sized avatar

Pierre-Luc Paour paour

View GitHub Profile
@ayyybe
ayyybe / ccdl.command
Last active April 9, 2024 09:04
Adobe Offline Package Builder v0.1.2 (macOS only) --- No longer being maintained.
#!/bin/bash
CYAN="$(tput bold; tput setaf 6)"
RESET="$(tput sgr0)"
clear
if command -v python3 > /dev/null 2>&1; then
if [ $(python3 -c "print('ye')") = "ye" ]; then
clear
@Obbut
Obbut / Adding a Physical Disk to Parallels.md
Last active January 23, 2024 08:06
Adding a second physical disk to Parallels

Adding a second physical disk to Parallels Desktop 14

I wanted my (NTFS) data disk to be accessible from my boot camp Parallels VM. Parallels provides no support for this, so I tried it myself.

I duplicated the disk file that Parallels created and started poking around, and after half an hour or so, had success. This is what you need to do.

My boot camp disk is at /dev/disk0. My data disk is at /dev/disk1.

These instructions are provided for educational use only and without guarantees. If you lose data because of this, blame yourself, and only follow them if you know what you are doing.

@dlebech
dlebech / Gerrit comment formatting
Last active January 17, 2024 10:34
Comment formatting in Gerrit
The documentation for Gerrit when it comes to formatting comments is quite lacking. Here is short list created by trial and error and looking at the source code in:
./gerrit-gwtexpui/src/main/java/com/google/gwtexpui/safehtml/client/SafeHtml.java
Lists:
* List item 1
* List item 2
- List item 1
- List item 2
@dmarcato
dmarcato / strip_play_services.gradle
Last active December 21, 2022 10:10
Gradle task to strip unused packages on Google Play Services library
def toCamelCase(String string) {
String result = ""
string.findAll("[^\\W]+") { String word ->
result += word.capitalize()
}
return result
}
afterEvaluate { project ->
Configuration runtimeConfiguration = project.configurations.getByName('compile')
@wbroek
wbroek / genymotionwithplay.txt
Last active February 12, 2024 03:22
Genymotion with Google Play Services for ARM
NOTE: Easier way is the X86 way, described on https://www.genymotion.com/help/desktop/faq/#google-play-services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
#!/bin/bash
echo '#!/bin/bash'
echo ''
echo 'failed_items=""'
echo 'function install_package() {'
echo 'echo EXECUTING: brew install $1 $2'
echo 'brew install $1 $2'
echo '[ $? -ne 0 ] && $failed_items="$failed_items $1" # package failed to install.'
echo '}'
@jdamcd
jdamcd / AllEmailAdapter.java
Last active December 12, 2015 10:49
Email adapter for AutoCompleteTextView that looks for emails from all account types, not just Google.
private static final String EMAIL_REGEX = "^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$";
private static final Pattern EMAIL_PATTERN = Pattern.compile(EMAIL_REGEX);
private ArrayAdapter<String> getEmailAddressAdapter(Context context) {
Account[] accounts = AccountManager.get(context).getAccounts();
HashSet<String> emailSet = new HashSet<String>();
for (int i = 0; i < accounts.length; i++) {
if (isEmailAddress(accounts[i].name)) {
emailSet.add(accounts[i].name);
}
@ben-efiz
ben-efiz / gist:4494099
Last active December 10, 2015 21:18
Little python script for replacing all localization with a large arrays.xml with keys and putting the string values into a new strings.xml Why doing so? See here http://developer.sinnerschrader-mobile.com/moving-localization-from-arrays-xml-to-strings-xml/463/
#!/usr/bin/python
import argparse
parser = argparse.ArgumentParser(description='Replacing values in arrays.xml with @string/ links. Generates two new files: <input>.new (edited arrays.xml containing the string links) and <input>.strings (resources file containing the new string keys)')
parser.add_argument('-i', '--input', help='Input file, e.g. arrays.xml', metavar='FILE', required=True)
parser.add_argument('-p', '--prefix', help='Optional prefix added to each new string key, e.g. array_')
args = vars(parser.parse_args())
xmlString = ' <string name=\"{0}\">{1}</string>'