Skip to content

Instantly share code, notes, and snippets.

View BodhiHu's full-sized avatar
🌴
bodhicitta

Bodhi BodhiHu

🌴
bodhicitta
  • AMD
  • Shanghai
View GitHub Profile
@ishitcno1
ishitcno1 / UserPanelDialogFragment.java
Created March 7, 2014 09:14
A custom DialogFragment that can be positioned and set size. Make sure to use 9patch background. Ref: http://stackoverflow.com/questions/9698410/position-of-dialogfragment-in-android
public class UserPanelDialogFragment extends DialogFragment implements View.OnClickListener {
private boolean isLogin = false;
private TextView mRegister;
private TextView mLogin;
private TextView mFeedback;
private TextView mUserId;
private TextView mLogout;
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active May 19, 2025 18:08
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@mingfang
mingfang / convert id_rsa to pem
Last active December 12, 2024 12:13
Convert id_rsa to pem file
openssl rsa -in ~/.ssh/id_rsa -outform pem > id_rsa.pem
chmod 600 id_rsa.pem
@Qvatra
Qvatra / FixedMasonryLayout.js
Created March 26, 2015 10:50
fixed masonry layout for famous-flex LayoutController
/**
* This Source Code is licensed under the MIT license. If a copy of the
* MIT-license was not distributed with this file, You can obtain one at:
* http://opensource.org/licenses/mit-license.html.
*
* @author: Oleksandr Zinchenko (Qvatra)
* @license MIT
*/
/*global console*/
@BodhiHu
BodhiHu / clone.js
Last active January 3, 2016 05:08
Deep clone an JS object: non recursive way. This originally is a fix of the famous.utilities.Utility.clone method (https://github.com/SeanOceanHu/famous/blob/develop/src/utilities/Utility.js#L115), which could easily cause call stack overflow)
/*
* Trampoline to avoid recursion in JS, see:
* http://www.integralist.co.uk/posts/js-recursion.html
*/
function trampoline() {
var func = arguments[0];
var args = [];
for (var i = 1; i < arguments.length; i++) {
args[i - 1] = arguments[i];
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@ShankarSumanth
ShankarSumanth / Stop Jenkins on Mac
Created October 1, 2016 14:43
Command to stop Jenkins on OSX/Mac
sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist
@oofnikj
oofnikj / answerfile
Last active May 23, 2025 01:37
Install Docker on Termux
KEYMAPOPTS="us us"
HOSTNAMEOPTS="-n alpine"
INTERFACESOPTS="auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
hostname alpine
"
TIMEZONEOPTS="-z UTC"