Skip to content

Instantly share code, notes, and snippets.

View muhammad-naderi's full-sized avatar

Muhammad Naderi muhammad-naderi

View GitHub Profile
@muhammad-naderi
muhammad-naderi / functions-mu-encryption.php
Created July 12, 2016 11:57
Wordpress encrypt usermeta data database
<?php
/**
* Created by PhpStorm.
* User: Muhammad
* Date: 05/07/2016
* Time: 01:20 PM
*/
add_filter('get_user_metadata', 'decrypt_user_meta',10,4);
@rodrigohenriques
rodrigohenriques / ClickToSelectEditText.java
Last active February 12, 2023 07:44
Used to make your EditText a better option than Spinners
public class ClickToSelectEditText<T extends Listable> extends AppCompactEditText {
List<T> mItems;
String[] mListableItems;
CharSequence mHint;
OnItemSelectedListener<T> onItemSelectedListener;
public ClickToSelectEditText(Context context) {
super(context);
@JeffBelback
JeffBelback / docker-destroy-all.sh
Last active December 12, 2023 17:47
Destroy all Docker Containers and Images
#!/bin/bash
# Stop all containers
containers=`docker ps -a -q`
if [ -n "$containers" ] ; then
docker stop $containers
fi
# Delete all containers
containers=`docker ps -a -q`
if [ -n "$containers" ]; then
docker rm -f -v $containers
@mightyfrog
mightyfrog / winzipaes.md
Last active March 21, 2017 20:14
winzipaes sample code

###winzipaes

how to zip

final String path = "/data/data/package-name/databases/my.db";
final File dbFile = new File(path);
final File file = new File(backupRoot, "db.zip");
AesZipFileEncrypter ze = null;
try {
    final AESEncrypter aesEncrypter = new AESEncrypterBC();
@troydean
troydean / lgbk_add_member.php
Created March 3, 2014 10:51
WooCommerce Change User Role on Purchase of Specific Product
function lgbk_add_member( $order_id ) {
$order = new WC_Order( $order_id );
$items = $order->get_items();
foreach ( $items as $item ) {
$product_name = $item['name'];
$product_id = $item['product_id'];
$product_variation_id = $item['variation_id'];
}
@cmtsij
cmtsij / google.xml
Last active July 11, 2019 06:45
Custom "Google Map" source for Mobile Atlas Creator 1.9.8
<!--
custom "Google Map" source for Mobile Atlas Creator 1.9.8
save in *.xml and move to /mapsources
-->
<customMapSource>
<name>Google Map</name>
<minZoom>0</minZoom>
<maxZoom>20</maxZoom>
<tileType>PNG</tileType>