Skip to content

Instantly share code, notes, and snippets.

Avatar

金马 lijinma

View GitHub Profile
View Kaybase.md

Keybase proof

I hereby claim:

  • I am lijinma on github.
  • I am jinma (https://keybase.io/jinma) on keybase.
  • I have a public key ASBA3XL8cTF-2QTXhNy0ytdS7miSIyNq9q0Jh-aKSgLwQQo

To claim this, I am signing this object:

View gist:b3a7d7a7994702f1daa1296c00897cbe
### Keybase proof
I hereby claim:
* I am lijinma on github.
* I am jinma (https://keybase.io/jinma) on keybase.
* I have a public key ASBA3XL8cTF-2QTXhNy0ytdS7miSIyNq9q0Jh-aKSgLwQQo
To claim this, I am signing this object:
View press.one
{"sig":"9d66b4810599f10c4f581a9b2b2f7c94e3188cc49fa37e0532e5f74efca53cbb4c0f8fbfe26d2166579d402768176bc58a04072f5c1276a120f7a45f6c62e4fc0","msghash":"abb270f97dd113bbeae80af26dee0ba64ee6c5d37140f42173de077ec5bec462"}
@lijinma
lijinma / markdownhere.css
Last active Jun 19, 2017 — forked from xiaolai/markdownhere.css
markdown-here-css
View markdownhere.css
.markdown-here-wrapper {
font-size: 16px;
line-height: 1.8em;
letter-spacing: 0.1em;
}
pre, code {
font-size: 14px;
font-family: Roboto, 'Courier New', Consolas, Inconsolata, Courier, monospace;
@lijinma
lijinma / bash_aliases
Created Jul 31, 2014 — forked from frdmn/bash_aliases
Nginx configuration
View bash_aliases
alias nginx.start='sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.nginx.plist'
alias nginx.stop='sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.nginx.plist'
alias nginx.restart='nginx.stop && nginx.start'
alias php-fpm.start="launchctl load -w ~/Library/LaunchAgents/homebrew-php.josegonzalez.php55.plist"
alias php-fpm.stop="launchctl unload -w ~/Library/LaunchAgents/homebrew-php.josegonzalez.php55.plist"
alias php-fpm.restart='php-fpm.stop && php-fpm.start'
alias mysql.start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist"
alias mysql.stop="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist"
alias mysql.restart='mysql.stop && mysql.start'
alias nginx.logs.error='tail -250f /usr/local/etc/nginx/logs/error.log'
@lijinma
lijinma / Max sum of sub array
Last active Aug 29, 2015
Get max sum of sub array in a array
View Max sum of sub array
#include <iostream>
using namespace std;
int maxSumOfSubArray (int * array, int length)
{
int sum = 0;
int result = 0;
for (int index = 0; index < length; index ++) {
if (sum + array[index] > array[index]) {
sum = sum + array[index];
View Drag
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Drag</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.js"></script>
<style>
.b_step33 .block_right .list li { float:left; display:block; line-height:140%; margin-bottom:2px; }
.b_step33 .block_right .list li.dot { height:36px; padding:5px 8px; background:#F5F6FA; }
@lijinma
lijinma / addvh.sh
Last active Aug 29, 2015
Auto add virtual host for Apache
View addvh.sh
#! /bin/bash
httpd_conf_file='/etc/apache2/httpd.conf';
hosts_file='/etc/hosts';
server_name='';
function check()
{
if [ "$httpd_conf_file" = "" ]; then
echo "You must config the httpd_conf_file!";
View gist:9461500
/*
On OS X, basic text manipulations (left, right, command+left, etc) make use of the system key bindings,
and don't need to be repeated here. Anything listed here will take precedence, however.
*/
[
{ "keys": ["super+shift+n"], "command": "new_window" },
{ "keys": ["super+shift+w"], "command": "close_window" },
{ "keys": ["super+o"], "command": "prompt_open" },
{ "keys": ["super+shift+t"], "command": "reopen_last_file" },
{ "keys": ["super+alt+up"], "command": "switch_file", "args": {"extensions": ["cpp", "cxx", "cc", "c", "hpp", "hxx", "h", "ipp", "inl", "m", "mm"]} },
View Json处理问题
var obj1 =
[
{
userid: 'james',
status: 'open',
open_count: 2
},
{