Skip to content

Instantly share code, notes, and snippets.

View quangson91's full-sized avatar
🎯
Focusing

QuangSon quangson91

🎯
Focusing
  • Freedom
  • Earth
View GitHub Profile
@matgis
matgis / defold-editor-dev-workflow.md
Last active May 23, 2024 07:26
How I work on the Defold Editor

The way I typically work is, I start the editor from the Terminal using lein run.

cd editor
lein run

Then load a project as usual in the editor. If for example I wanted to explore the Sprite component, I'd create a new Sprite somewhere in the project and open it.

From Cursive, I have a Remote REPL run configuration set up, as detailed in our Cursive Setup Guide. When I run it, it will connect to the running editor process I started from the Terminal.

@jenthone
jenthone / __python_tricks__
Last active April 21, 2023 18:04
Python - Competitive Programming Tricks
Python - Competitive Programming Tricks
/*
* Copyright (C) 2018 Square, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
api=28
branch=android-9.0.0_r3
mkdir android-sdk-source-build
cd android-sdk-source-build
mkdir -p frameworks/base
# Fetch repositories that contain the sources we're interested in
git clone --depth 1 https://android.googlesource.com/platform/frameworks/base -b $branch frameworks/base
@vgaidarji
vgaidarji / AndroidStudio as git difftool, mergetool
Last active March 13, 2020 09:23
Use AndroidStudio as git difftool/mergetool on MacOS (place this inside your ~/.gitconfig).
[merge]
tool = studio
[mergetool "studio"]
prompt = false
cmd = /Applications/Android\\ Studio.app/Contents/MacOS/studio merge $(cd $(dirname "$LOCAL") && pwd)/$(basename "$LOCAL") $(cd $(dirname "$REMOTE") && pwd)/$(basename "$REMOTE") $(cd $(dirname "$BASE") && pwd)/$(basename "$BASE") $(cd $(dirname "$MERGED") && pwd)/$(basename "$MERGED")
trustExitCode = true
[diff]
tool = studio
[difftool "studio"]
prompt = false
@bkase
bkase / prnsaaspfruicc.md
Created March 3, 2016 22:58
Production-Ready(?) Native Single-Atom-State Purely Functional Reactive Composable UI Components, or PRNSAASPFRUICC

Production-Ready(?) Native Single-Atom-State Purely Functional Reactive Composable UI Components, or PRNSAASPFRUICC

The native UI toolkits on Android and iOS are frustratingly imperative. Unfortunately, there has been little architecture evolution (unlike the web). However, nothing(ish) is stopping us from bolting something "nice" on top. By nice I mean single-atom-state purely functional reactive composable UI components. In this post, I'll explain what this title means, the inspiration behind the design of the framework, an example component, and dive a little into the framework's implementation.

Right now, there only exists a Kotlin (Android) implementation, but a Swift port will be relatively straightforward and will happen soon.

Let's break down the title:

  • "Production-Ready"
@pepyakin
pepyakin / ExampleApplication.java
Created May 21, 2015 14:48
Gist which should prevent leaks of Activity in ClipboardUIManager.
public class ExampleApplication extends Application {
@Override public void onCreate() {
super.onCreate();
try {
Class<?> cls = Class.forName("android.sec.clipboard.ClipboardUIManager");
Method m = cls.getDeclaredMethod("getInstance", Context.class);
Object o = m.invoke(null, this);
} catch (Exception ignored) { }
}
}
@sebz
sebz / grunt-hugo-lunrjs.md
Last active June 28, 2024 18:41
hugo + gruntjs + lunrjs = <3 search
@FriendlyTester
FriendlyTester / AndroidRecord.sh
Created January 30, 2015 17:04
BASH script to record Android display and download/delete the video
#Check if an argument was supplied
if [ -z "$1" ]
then
echo "No argument supplied, please provide video name"
else
# start recording
adb shell screenrecord --bit-rate 6000000 /sdcard/$1.mp4 &
# Get its PID
PID=$!
@LeCoupa
LeCoupa / bash-cheatsheet.sh
Last active September 17, 2024 17:14
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04