Skip to content

Instantly share code, notes, and snippets.

@linkarys
linkarys / genymotionwithplay.txt
Created February 24, 2016 09:40 — forked from wbroek/genymotionwithplay.txt
Genymotion with Google Play Services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
Google Apps for Android 4.4.4 (https://www.androidfilehost.com/?fid=23501681358544845 - gapps-kk-20140606-signed.zip)
Google Apps for Android 4.3 (https://www.androidfilehost.com/?fid=23060877490000124 - gapps-jb-20130813-signed.zip)
@linkarys
linkarys / XiamiUnlikeBtn
Last active August 29, 2015 14:21
Xiami musci unlike button
(function() {
var $player = $('#J_playTracksList'),
$controls = $player.find('.ui-track-control');
$player.off('click.xm.hate').on('click.xm.hate', '.no-more', function() {
var id = $(this).closest('.ui-track-item').data('sid');
$.get('http://www.xiami.com/kuang/unlike', $.param({id: id}));
console.log('unlike id:', id);
<?php
class HurryHenryHooray {
const SEQ_START = 1; // 报数的起始值
const SEQ_END = 100; // 报数的结束値
private $map = []; // 保存数字与字符串的对应关系
public function HurryHenryHooray ($num1, $num2, $num3) {
if ( $this->isValid($num1) && $this->isValid($num2) && $this->isValid($num3) ) {
@linkarys
linkarys / command-profile.sh
Created April 20, 2014 01:08
command line profile
# See http://www.shellperson.net/using-sudo-with-an-alias/
alias sudo='sudo '
# This helps me edit files that my user isn't the owner of
alias edit='SUDO_EDITOR="open -FWne" sudo -e'
# The alias that takes me here - to editing these very aliases
alias edit_profile='open -e ~/.profile'
# I do a lot of web development, so I need to edit these non-owned files fairly often
test:
npm install karma-jasmine --save-dev
npm install karma-chrome-launcher --save-dev
@linkarys
linkarys / sublime-plugin.py
Last active August 29, 2015 13:57
sublime plugin notes
### Insert text to new file
### ----------------------------------------------------
### ====================================================
import sublime
import sys
view = sublime.active_window().new_file()
def insert_text(view):
#ssh
ssh root@ip
# 1. 安装桌面系统
yum groupinstall "Desktop"
yum groupinstall "X Window System"
# 启动gnome
startx
# 然后按下Ctrl+Alt+F2
# nginx
$ sudo apt-get install nginx
$ sudo service nginx start # Doesn't start itself upon install
# I ran this as root You may need to curl <URL> | sudo tee /etc/nginx/mime.types
$ curl https://raw.github.com/h5bp/server-configs-nginx/master/mime.types > /etc/nginx/mime.types
# nginx laravel
server {
listen 80;
server_name sunshine.us;
-- get row number
select @n:=@n+1 as row_num, column_name from table, (select @n:=0) t2;
-- mysql
mysql -h host_name -p -u user_name;
-- tee
mysql --tee=tmp.out cookbook;
mysql> \T tmp.out -- Loggin to file 'tmp.out'
mysql> \t -- Outfile disabled.
@linkarys
linkarys / git-cheatsheet
Created November 29, 2013 04:48
git-cheatsheet
# store credentials
#keep your password cached in memory for (by default) 15 minutes.
git config --global credential.helper cache
# set a longer timeout
git config --global credential.helper "cache --timeout=3600"
#another way
git config remote.origin.url https://you:password@github.com/you/example.git