Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View yourtion's full-sized avatar
🎯
Focusing

郭宇翔 yourtion

🎯
Focusing
View GitHub Profile
@yourtion
yourtion / Sublime Text Package Install
Created October 8, 2013 07:36
Sublime Text 2 插件安装的方法
1.直接安装
安装Sublime text 2插件很方便,可以直接下载安装包解压缩到Packages目录(Data\Packages)
打开Packages的方法:在Sublime text 2的菜单中找到->preferences->packages。
2.使用Package Control组件安装
也可以安装package control组件,然后直接在线安装:
按Ctrl+`调出console
复制粘贴以下代码并去掉换行,到底部命令行并回车:
@yourtion
yourtion / comm.md
Created October 12, 2013 08:56
MacFinder显示所有文件

开启

defaults write com.apple.Finder AppleShowAllFiles YES

关闭

defaults write com.apple.Finder AppleShowAllFiles NO

执行后重启Finder

>killall Finder

@yourtion
yourtion / hunluan.py
Created October 22, 2013 03:44
Python代码是用来生成一些彭罗斯铺砖 From http://blogread.cn/it/article/4318?f=wb2
_ =\\
"""if!
1:"e,V=100
0,(0j-1)**-.2;
v,S=.5/ V.real,
[(0,0,4 *e,4*e*
V)];w=1 -v"def!
E(T,A, B,C):P
,Q,R=B*w+ A*v,B*w+C
*v,A*w+B*v;retur n[(1,Q,C,A),(1,P
@yourtion
yourtion / videoInfo.php
Created November 13, 2013 01:47
优酷、土豆、56获取视频截图和标题和播放swf代码 From http://blog.csdn.net/braverior/article/details/8986971
<?php
class YoukuVideo
{
var $url;
var $content;
var $videoswfstr;
var $playhtmlstr;
var $picurl;
@yourtion
yourtion / scroll.js
Created November 15, 2013 03:22
jQuery平滑滚动页面到某个锚点 From http://www.sharejs.com/codes/javascript/1089
$(document).ready(function() {
$("a.topMap").click(function() {
$("html, body").animate({
scrollTop: $($(this).attr("href")).offset().top + "px"
}, {
duration: 500,
easing: "swing"
});
return false;
});
@yourtion
yourtion / 1.oneLineHtml.html
Last active December 28, 2015 15:59
One Line HTML5——一行HTML5代码 http://www.csscoo.com/?p=1025
data:text/html, <html contenteditable>
@yourtion
yourtion / dnspod-ddns.py
Created November 18, 2013 12:47
DNSPod-DDNS
#!/usr/bin/env python
#-*- coding:utf-8 -*-
import urllib2
import urllib
import json
import time
import socket
public_dic={}
public_dic["login_email"]="" #replace your email

##建新数据库目录

mkdir /media/hda11/db

##复制linux下原数据到新目录下

cp -dpR /var/lib/mysql/* /media/hda11/db

##给新目录重命属性

PPA地址:https://launchpad.net/~git-core/+archive/ppa
支持所有的Ubuntu版本。
运行命令:
sudo apt-add-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git
如果本地已经安装过Git,可以使用升级命令:
@yourtion
yourtion / err
Created December 11, 2013 02:40
解决安装 mysql2 gem 时出问题, *** extconf.rb failed ***
Building native extensions. This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
checking for rb_thread_blocking_region()... yes
checking for rb_wait_for_single_fd()... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no