Skip to content

Instantly share code, notes, and snippets.

backupdir=/home/mysql_backup
time=` date +%Y_%m_%d_%H_%M_%S `
db_host=xx.xx.xx.xx|localhost
db_user=xxx
db_pass=xxx
db_name=xxx
mysqldump -h $db_host -u $db_user -p$db_pass $db_name | gzip > $backupdir/$time.sql.gz
find $backupdir -name "*.sql.gz" -type f -mtime +5 -exec rm -rf {} \; > /dev/null 2>&1
@feng88724
feng88724 / CapturePhotoUtils.java
Last active August 16, 2018 09:33 — forked from samkirton/gist:0242ba81d7ca00b475b9
Fixed a bug where images added to the MediaStore are not inserted at the front of the gallery
package com.memtrip;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.OutputStream;
import android.content.ContentResolver;
import android.content.ContentUris;
import android.content.ContentValues;
import android.graphics.Bitmap;
@feng88724
feng88724 / TouchImageView
Created April 23, 2013 02:49
Simple TouchImageView for Android. drag freely.
import android.app.Activity;
import android.content.Context;
import android.graphics.Color;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.animation.TranslateAnimation;
import android.widget.ImageView;