Skip to content

Instantly share code, notes, and snippets.

View Chuckytuh's full-sized avatar

João Gonçalves Chuckytuh

View GitHub Profile
// It is important to declare your variables.
(function() {
var foo = 'Hello, world!';
print(foo); //=> Hello, world!
})();
// Because if you don't, the become global variables.
(function() {
@Chuckytuh
Chuckytuh / SimpleHTTPServerWithUpload.py
Created October 1, 2015 18:22 — forked from UniIsland/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload
#!/usr/bin/env python
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""
@Chuckytuh
Chuckytuh / OSX Set GUI env var
Created October 28, 2015 22:02
On OSX env vars aren't available for GUI applications.
launchctl setenv PATH $PATH
killall Dock && killall SystemUIServer && killall Finder
@Chuckytuh
Chuckytuh / VSCode debug install cordova plugin
Last active April 23, 2023 08:54
This launch.json configuration is helpful for cordova hook development. It allows to launch cordova cli with VSCode debugger attached so we can place breakpoints on our hook scripts.
{
// Use IntelliSense to learn about possible Node.js debug attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
@Chuckytuh
Chuckytuh / ExampleFragment.java
Created February 13, 2017 01:44 — forked from devunwired/ExampleFragment.java
Method for animating Android fragment positions during a add/replace/remove transition using custom properties. This method does not require subclassing target views with additional setter methods, but instead requires subclassing the fragment...something you are likely already doing.
/**
* An example of adding these transitions to a Fragment. This simple
* version just applies opposite transitions to any Fragment whether it is
* entering or exiting view. You can also inspect the transit mode parameter
* (i.e. TRANSIT_FRAGMENT_OPEN, TRANSIT_FRAGMENT_CLOSE) in combination to do
* different animations for, say, adding a fragment versus popping the back stack.
*
* Transactions without an explicit transit mode set, in this example, will not
* animate. Allowing the initial fragment add, for example, to simply appear.
*/
@Chuckytuh
Chuckytuh / embed_framework_hook.js
Created February 27, 2018 16:48
Cordova hook to embed an iOS framework that is a dependency on a cordova plugin.
// This hook expects that the framework dependency is defined on plugin.xml.
// Example:
// <platform name="ios">
// <!-- .... -->
// <framework src="path/to/FRAMEWORK_NAME.framework" custom="true" embed="true" />
// </platform>
// For the OutSystems platform it is better to add this hook on both events. As so:
// <platform name="ios">
// <!-- .... -->
// <hook type="after_plugin_install" src="path/to/thishook/embed_framework_hook.js" />
@Chuckytuh
Chuckytuh / createuser.sh
Created March 6, 2020 17:56 — forked from cmfsotelo/createuser.sh
Create User Script
#!/bin/bash
# This script creates a user account under Mac OS X
usage() {
echo " Synopsis"
echo ' create-user userName userFullName userPassword groupId'
echo ""
echo ""
echo " Description"
echo " Creates a new user with the given params and attributes to the desired group"
}
@Chuckytuh
Chuckytuh / readme.md
Last active January 26, 2022 23:38
Retrieve content of debuggable android application

Retrieve content of debuggable android application

Whenever you need to see the content of an Android application that is in debug mode and you want to do it over adb just do the following:

$ adb shell
$ run-as some.package.identifier 

This will change your prompt to be authenticated into the app space and your cwd changed to the app’s , from there you can do the typical ls, cd, etc within the app’s domain space.

@Chuckytuh
Chuckytuh / release-android-debuggable.md
Created February 26, 2024 17:37 — forked from nstarke/release-android-debuggable.md
How to make a Release Android App debuggable

How to make a Release Android App debuggable

Let's say you want to access the application shared preferences in /data/data/com.mypackage.
You could try to run adb shell and then run-as com.mypackage ( or adb shell run-as com.mypackge ls /data/data/com.mypackage/shared_prefs), but on a production release app downloaded from an app store you're most likely to see:

run-as: Package 'com.mypackage' is not debuggable