Skip to content

Instantly share code, notes, and snippets.

View kran's full-sized avatar
🌴
On vacation

Chao’s kran

🌴
On vacation
View GitHub Profile
@kran
kran / blogger-forx.xml
Last active April 20, 2022 21:08
blogger theme ported from typecho theme (forx)
<?xml version="1.0" encoding="utf-8"?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:b="http://www.google.com/2005/gml/b" xmlns:data="http://www.google.com/2005/gml/data" xmlns:expr="http://www.google.com/2005/gml/expr">
&lt;!--<head>--&gt;&lt;head&gt;
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
<meta content="yes" name="apple-mobile-web-app-capable" />
<meta content="black" name="apple-mobile-web-app-status-bar-style" />
<meta content="telephone=no" name="format-detection" />
<meta name="renderer" content="webkit" />
<b:include data="blog" name="all-head-content"/>
@kran
kran / gridly.css
Created September 2, 2014 07:28
css for postach
@import url('http://fonts.useso.com/css?family=Droid+Sans:400,700|Vollkorn:400italic');
/**
* Page styles
*/
/*---------------------------------------------------
LESS Elements 0.9.1
---------------------------------------------------
A set of useful LESS mixins
More info at: http://lesselements.com
MODIFIED BY: Brandon Brown
<?php namespace Tmb;
use Illuminate\Database\Eloquent\Model as Eloquent;
use Illuminate\Validation\Validator;
class BaseModel extends Eloquent
{
/**
* Error message bag
// answer to http://weibo.com/1915548291/z2UtyzuvQ
// see also http://www.cnblogs.com/baiyanhuang/archive/2012/11/11/2764914.html
#include <boost/bind.hpp>
#include <boost/function.hpp>
#include <boost/noncopyable.hpp>
#include <boost/ptr_container/ptr_vector.hpp>
#include <fstream>
#include <iostream>
@kran
kran / theme.html
Created January 6, 2014 15:30
postach.io theme
<!DOCTYPE html>
<html lang="en-US" prefix="og: http://ogp.me/ns#">
<head>
<meta charset="utf-8">
<title>{% if is_home %}{{ site.author }}{% elif is_post %}{{ post.title }}{% elif is_link %}{{ link.title }}{% elif is_page %}{{ page.title }}{% endif %} | {{ site.name }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
@kran
kran / macvim.vim
Created October 28, 2013 12:37
macvim.vim
" MacVim colorscheme
"
" Maintainer: Bjorn Winckler <bjorn.winckler@gmail.com>
" Last Change: 2008 May 9
"
" This is the default MacVim color scheme. It supports both light and dark
" backgrounds (see :h 'background').
"
@kran
kran / lua-resty-router.lua
Last active April 30, 2017 00:37
router for openresty, dev state
local ngx = require"ngx"
local setmetatable = setmetatable
local insert = table.insert
local pairs = pairs
local ipairs = ipairs
local type = type
local strlen = string.len
local substr = string.sub
local pp = require'prettyprint'
local match = string.match
--[[
usage:
local form = multipart:new()
-- set any opts
form:parse()
-- form.fields
]]
local ngx = require("ngx")
local upload = require("resty.upload")
@kran
kran / gist:6308080
Created August 22, 2013 14:40
install vim config
#!/bin/bash
cd $HOME
#vimpath=".vim/bundle"
vimpath=".vim/bundle"
mkdir -p $vimpath && cd $vimpath
echo woring in [`pwd`]
git clone https://github.com/gmarik/vundle.git
curl -o ~/.vimrc https://gist.github.com/kran/2886745/raw/f42600943517f20fd1e6773a99cf5af02c0763d5/.vimrc
@kran
kran / gist:6291095
Last active December 21, 2015 10:19
change xfce global key theme to emacs
xfconf-query -c xsettings -p /Gtk/KeyThemeName -s Emacs
/usr/bin/setxkbmap -option "ctrl:swapcaps"