Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
CUR_DIR=`pwd`
if [ ! -f "AndroidManifest.xml" ]; then
echo "AndroidManifest.xml NOT FOUND" >&2
exit 1
fi
@alexsunday
alexsunday / post-receive
Last active August 29, 2015 14:19
自动部署git应用到服务器,服务器端的 bare仓库的hooks脚本
#!/usr/bin/env bash
APP_NAME=huate
DEPLOY=deploy.sh
APP_DIR=/wwwroot/huateBackend
BAK_DIR=/home/pyapp/bak
unset GIT_DIR
read oldrev newrev refname
@alexsunday
alexsunday / hc_netsdk_cb_demo.c
Created July 6, 2015 10:19
海康摄像头使用回调模式取得数据。
#include <stdio.h>
#include <windows.h>
#include "HCNetSDK.h"
void CALLBACK mucbfunc(LONG lRealHandle,DWORD dwDataType,BYTE *pBuffer,DWORD dwBufSize,void *pUser)
{
printf("IN [%d]\n", dwBufSize);
}
#!/usr/bin/env python
# encoding: utf-8
from __future__ import unicode_literals
from __future__ import print_function
import os
import pty
import socket
import select
assume cs:code
data segment
;db '0123456789ABCDEF'
db '1. file '
db '2. edit '
db '3. view '
db '4. tool '
db '5. help '
data ends
assume cs:code
; 用div 计算 data 段中,第一个数据除以第二个数据,商存第三个存储单元中
data segment
dd 100001
dw 100
dw 0
data ends
stack segment stack
assume cs:code,ds:data,ss:stack
; 将 data 段中的数据按如下格式写入到 table 段
; 并计算21年中的人均收入(取整)
; 结果也按照下面的格式写入到 table 段
data segment
db '1975','1976','1977','1978','1979','1980','1981','1982','1983'
db '1984','1985','1986','1987','1988','1989','1990','1991','1992'
db '1993','1994','1995'
;以上是表示21年的21个字符串 year
assume cs:code, ds:data, ss:stack
data segment
db 'welcome to masm!'
data ends
stack segment stack
db 128 dup (0)
stack ends
assume cs:code,ds:data,ss:stack
data segment
dw 12213, 31361
data ends
stack segment stack
db 128 dup (0)
stack ends
assume cs:code,ds:data,ss:stack
data segment
db '1975','1976','1977','1978','1979','1980','1981','1982','1983'
db '1984','1985','1986','1987','1988','1989','1990','1991','1992'
db '1993','1994','1995'
;以上是表示21年的21个字符串 year
dd 16,22,382,1356,2390,8000,16000,24486,50065,9749,14047,19751
dd 34598,59082,80353,11830,18430,27590,37530,46490,59370