Skip to content

Instantly share code, notes, and snippets.

View mlzxy's full-sized avatar

Xinyu Zhang mlzxy

  • Rutgers University
  • New Brunswick, NJ
View GitHub Profile
@mlzxy
mlzxy / SassMeister-input.scss
Last active August 29, 2015 14:25
Sass 通过@for生成代码例子
// ----
// libsass (v3.2.5)
// ----
$aseq-10:10,20,30,40,50,60,70,80,90,100;
.h-full{
height:100% !important;
}
mysql -u root -p ##登陆
## in mysql console
CREATE DATABASE wordpressdb;
CREATE USER wordpressuser@localhost IDENTIFIED BY 'wordpresspassword';
GRANT ALL PRIVILEGES ON wordpressdb.* TO wordpressuser@localhost;
FLUSH PRIVILEGES;
exit
@mlzxy
mlzxy / PlatformDetectAndRedirect.js
Last active October 20, 2016 19:27
Detect platform and redirect for app downloading or app custom schema url
(function() {
var TIMEOUT = 300;
var platform = {
Android: function() {
return navigator.userAgent.match(/Android/i);
},
BlackBerry: function() {
return navigator.userAgent.match(/BlackBerry/i);
},
iOS: function() {
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />
nvm alias default v0.x.x
@mlzxy
mlzxy / ffmpeg-install.sh
Last active August 29, 2015 14:26 — forked from clayton/ffmpeg-install.sh
Install FFMPEG on OS X with HomeBrew to convert Mp4 to WebM
# Installation
brew install ffmpeg --with-vpx --with-vorbis --with-libvorbis --with-vpx --with-vorbis --with-theora --with-libogg --with-libvorbis --with-gpl --with-version3 --with-nonfree --with-postproc --with-libaacplus --with-libass --with-libcelt --with-libfaac --with-libfdk-aac --with-libfreetype --with-libmp3lame --with-libopencore-amrnb --with-libopencore-amrwb --with-libopenjpeg --with-openssl --with-libopus --with-libschroedinger --with-libspeex --with-libtheora --with-libvo-aacenc --with-libvorbis --with-libvpx --with-libx264 --with-libxvid
# Easy Peasy
ffmpeg -i video.mp4 video.webm
@mlzxy
mlzxy / install_ffmpeg_ubuntu.sh
Last active August 29, 2015 14:26 — forked from xdamman/install_ffmpeg_ubuntu.sh
Install latest ffmpeg on ubuntu 12.04 or 14.04
#!/bin/bash
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04
# Inspired from https://gist.github.com/faleev/3435377
# Remove any existing packages:
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev
# Get the dependencies (Ubuntu Server or headless users):
sudo apt-get update
$http({method: 'GET', url: 'www.google.com/someapi', headers: {
'Authorization': 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='}
});
UUID (Universally Unique IDentifier) Is on a per-app basis. identifies an app on a device. As long as the user doesn’t completely delete the app, then this identifier will persist between app launches, and at least let you identify the same user using a particular app on a device. Unfortunately, if the user completely deletes and then reinstalls the app then the ID will change.
UDID (Unique Device Identifier) A sequence of 40 hexadecimal characters that uniquely identify an ios device. This value can be retrieved through iTunes, or found using UIDevice -uniqueIdentifier. Derived from hardware details like MAC address.
@mlzxy
mlzxy / scopeEventService.js
Created August 2, 2015 08:29
My favorite event mechanism in a angular app
var scopeEventService = function() {
var _event = {}; //visted info
var _handler = {
EventName1: {
codeBlockName:function(){} //handler
}
};