This file contains 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/sh | |
# 获取第一个参数 | |
hex=$1 | |
# 如果参数长度不等于 6,退出 | |
if [ ${#hex} -lt 6 ] | |
then | |
echo "参数长度错误,$hex:${#hex}" | |
exit -1 |
This file contains 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 | |
files='ls *.JPG' | |
for file in $files | |
do | |
filename="file=@$file" | |
curl -F "action=uploading" -F $filename http://path/to/uploadimg.do |
This file contains 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
import os.path | |
import requests | |
from lxml import etree | |
file_path = 'https://developer.apple.com/videos/wwdc/2014/' | |
sd_path = os.path.expanduser("~/Desktop/wwdc2014_sd.txt") | |
hd_path = os.path.expanduser("~/Desktop/wwdc2014_hd.txt") | |
pdf_path = os.path.expanduser("~/Desktop/wwdc2014_pdf.txt") | |
This file contains 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
str = ARGF.argv[0].strip.downcase | |
if str.start_with? '0x' | |
str.delete! '0x' | |
end | |
str.each_char do |c| | |
bin = c.to_i(16).to_s(2) | |
bin.insert(0, '0' * (4-bin.length)) if bin.length < 4 |
This file contains 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 <stdio.h> | |
/* | |
* 基姆拉尔森计算公式 | |
* W= (d+2*m+3*(m+1)/5+y+y/4-y/100+y/400) mod 7 | |
*/ | |
int week(int y, int m, int d) | |
{ | |
if (m < 3) { | |
m += 12; |
This file contains 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: UTF-8 -*- | |
import zipfile | |
import biplist | |
import tempfile | |
import shutil | |
import re | |
import os | |
This file contains 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
- (void)drawRect:(CGRect)rect | |
{ | |
if (!self.image) { | |
CGContextRef context = UIGraphicsGetCurrentContext(); | |
CGContextSetFillColorWithColor(context, self.backgroundColor.CGColor); | |
CGContextFillRect(context, rect); | |
return; | |
} | |
CGFloat w = CGRectGetWidth(self.frame); |
This file contains 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
set -g prefix C-g | |
setw -g mode-keys vi | |
unbind C-b | |
bind C-g send-prefix | |
bind -n C-\ split-window -h | |
bind -n C-M-\ split-window | |
bind -n F1 list-keys |
This file contains 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 ruby | |
require "date" | |
class Date | |
def weekday | |
case self.wday | |
when 0 then "日" | |
when 1 then "一" | |
when 2 then "二" |
This file contains 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
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. | |
; #Warn ; Enable warnings to assist with detecting common errors. | |
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. | |
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. | |
SetCapsLockState, AlwaysOff | |
+!m::SendInput +^m | |
!s::SendInput ^s | |
!a::SendInput ^a |
OlderNewer