Skip to content

Instantly share code, notes, and snippets.

View BodhiHu's full-sized avatar
🌴
bodhicitta

Bodhi BodhiHu

🌴
bodhicitta
  • AMD, SAP
  • Shanghai
View GitHub Profile
@oofnikj
oofnikj / answerfile
Last active May 4, 2024 12:20
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"
@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
@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

@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];
@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*/
@mingfang
mingfang / convert id_rsa to pem
Last active March 3, 2024 08:46
Convert id_rsa to pem file
openssl rsa -in ~/.ssh/id_rsa -outform pem > id_rsa.pem
chmod 600 id_rsa.pem
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active May 6, 2024 02:17
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!






\

@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;
@jo
jo / js-crypto-libraries.md
Last active March 31, 2024 20:33
List of JavaScript Crypto libraries.

JavaScript Crypto Libraries

List some crypto libraries for JavaScript out there. Might be a bit out dated. Scroll to the bottom.

WebCryptoAPI

http://www.w3.org/TR/WebCryptoAPI/

This specification describes a JavaScript API for performing basic cryptographic operations in web applications, such as hashing, signature generation and verification, and encryption and decryption. Additionally, it describes an API for applications to generate and/or manage the keying material necessary to perform these operations. Uses for this API range from user or service authentication, document or code signing, and the confidentiality and integrity of communications.

@JakeWharton
JakeWharton / OkHttpStack.java
Created May 21, 2013 01:14
A `HttpStack` implementation for Volley that uses OkHttp as its transport.
import com.android.volley.toolbox.HurlStack;
import com.squareup.okhttp.OkHttpClient;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
/**
* An {@link com.android.volley.toolbox.HttpStack HttpStack} implementation which
* uses OkHttp as its transport.
*/