This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "net/http" | |
| "strconv" | |
| ) | |
| func main() { | |
| fmt.Println("Hello world") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| find . -type f -maxdepth 4 -name config |xargs grep "url ="|awk '{print $4}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ffmpeg -i input.mp4 -vcodec libx264 -maxrate 1000k -bufsize 4000k -threads 0 -f mp4 output.mp4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Event::listen('illuminate.query', function($query, $bindings, $time, $name) { | |
| $data = compact('bindings', 'time', 'name'); | |
| // Format binding data for sql insertion | |
| foreach ($bindings as $i => $binding) {if ($binding instanceof \DateTime) { | |
| $bindings[$i] = $binding->format('\'Y-m-d H:i:s\''); | |
| } else if (is_string($binding)) { | |
| $bindings[$i] = "'$binding'"; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -module(test). | |
| -export([start_link/0]). | |
| -behaviour(gen_server). | |
| -export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]). | |
| -define(SERVER, ?MODULE). | |
| start_link() -> | |
| gen_server:start_link({local, ?SERVER}, ?MODULE, {}, []). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| deb http://mirrors.163.com/ubuntu/ precise main restricted universe multiverse | |
| deb http://mirrors.163.com/ubuntu/ precise-security main restricted universe multiverse | |
| deb http://mirrors.163.com/ubuntu/ precise-updates main restricted universe multiverse | |
| deb http://mirrors.163.com/ubuntu/ precise-proposed main restricted universe multiverse | |
| deb http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse | |
| deb-src http://mirrors.163.com/ubuntu/ precise main restricted universe multiverse | |
| deb-src http://mirrors.163.com/ubuntu/ precise-security main restricted universe multiverse | |
| deb-src http://mirrors.163.com/ubuntu/ precise-updates main restricted universe multiverse | |
| deb-src http://mirrors.163.com/ubuntu/ precise-proposed main restricted universe multiverse | |
| deb-src http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf8 -*- | |
| import sys | |
| from bs4 import BeautifulSoup | |
| reload(sys) | |
| sys.setdefaultencoding('utf8') | |
| f = open("/home/cain/bookmarks_3_21_14.html") | |
| content = f.read() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # create keystore file | |
| keytool -genkey -v -keystore [my-release-key].ketstore -keyalg RSA -validity 1000 -alias [some_alias] | |
| # sign package | |
| jarsigner -keystore my-release-key.ketstore [some-release-unsigned.apk] some_alias | |
| # verify signed package | |
| jarsigner -verify [some-release-unsigned.apk] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| lock file = /var/run/rsync.lock | |
| log file = /var/log/rsyncd.log | |
| pid file = /var/run/rsyncd.pid | |
| [appfolder] | |
| path = /your/path/here | |
| comment = Folder for apps | |
| uid = cain | |
| gid = cain | |
| read only = no |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| isEmail: function(email) { | |
| var splitted = email.match("^(.+)@(.+)$"); | |
| if (splitted == null) return false; | |
| if (splitted[1] != null) | |
| { | |
| var regexp_user = /^\"?[\w-_\.]*\"?$/; | |
| if (splitted[1].match(regexp_user) == null) return false; | |
| } | |
| if (splitted[2] != null) | |
| { |