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
| #!/usr/bin/env python | |
| import BaseHTTPServer | |
| import cgi | |
| import mimetypes | |
| import os | |
| import posixpath | |
| import shutil | |
| if not mimetypes.inited: |
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 table spoils ( | |
| id int primary key, | |
| amount int | |
| ); | |
| comment on table spoils is '分赃表'; | |
| comment on column spoils.id is '海盗编号'; | |
| comment on column spoils.amount is '可获得的最高金额,null代表死亡'; | |
| create or replace function divide(amount_total int, pirate_count int) | |
| returns setof spoils as $$ |
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
| #!/bin/bash | |
| case $1 in | |
| install|reinstall) | |
| options=S | |
| ;; | |
| remove) | |
| options=Rc | |
| ;; | |
| search) |
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
| (ns me.zzp.http | |
| (:require [clojure.string :refer [blank?]]) | |
| (:import java.io.PrintStream | |
| java.net.ServerSocket | |
| java.util.Scanner | |
| java.util.concurrent.atomic.AtomicLong) | |
| (:gen-class)) | |
| (defonce generitor (AtomicLong.)) |
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
| /* | |
| * Ctrl(C): ^ | |
| * Option(M): ~ | |
| */ | |
| { | |
| "^/" = "undo:"; | |
| "^a" = "moveToBeginningOfLine:"; | |
| "^e" = "moveToEndOfLine:"; | |
| "^g" = "_cancelKey:"; | |
| "^t" = "transpose:"; |
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
| [user] | |
| email = [email protected] | |
| name = redraiment | |
| [push] | |
| default = simple | |
| [credential] | |
| helper = store |
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
| UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:_toggle.bounds | |
| byRoundingCorners:(UIRectCornerTopLeft | UIRectCornerBottomLeft) | |
| cornerRadii:CGSizeMake(8.0, 8.0)]; | |
| CAShapeLayer *maskLayer = [CAShapeLayer new]; | |
| maskLayer.frame = _toggle.bounds; | |
| maskLayer.path = maskPath.CGPath; | |
| _toggle.layer.mask = maskLayer; |
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
| #include <stdlib.h> | |
| #include <stdio.h> | |
| #include <setjmp.h> | |
| jmp_buf __exception_context; | |
| #define try if(!setjmp(__exception_context)) | |
| #define catch else | |
| #define throw_exception longjmp(__exception_context, 1) | |
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
| (defun current-sentence () | |
| (interactive) | |
| (replace-regexp-in-string "\n" ";" | |
| (substring-no-properties | |
| (or (sentence-at-point) | |
| (save-excursion | |
| (backward-sentence) | |
| (sentence-at-point)))))) | |
| (defun commit-last-js () |
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
| var File = function(name) { | |
| this.file = new java.io.File(name); | |
| }; | |
| File.prototype.map = function(fn) { | |
| var fin = new java.util.Scanner(this.file); | |
| var content = []; | |
| while (fin.hasNextLine()) { | |
| content.push(fn(fin.nextLine())); | |
| } |