change jpg to png
bat
ren *.jpg *pngchange jpg to png
bat
ren *.jpg *png| function start_with($main_str, $str) { | |
| return substr_compare($main_str, $str, 0, strlen($str)) === 0; | |
| } | |
| function end_with($main_str, $str) { | |
| return substr_compare($main_str, $str, -1, strlen($str)) === 0; | |
| } |
| #!/usr/bin/python | |
| # coding=utf-8 | |
| import os.path | |
| import sys | |
| import shutil | |
| """ | |
| getpath.py [path] | |
| 命令行所在目录 |
| - (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification { | |
| // open app store link | |
| NSString * url = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/app/id%@", APP_STORE_ID]; | |
| [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]]; | |
| } | |
| // APP INFO URL: http://itunes.apple.com/lookup?id=APP_STORE_ID |
| Option Explicit | |
| Dim wshShell, shortcut | |
| Dim lnkpath, targetpath | |
| ' 生成的快捷方式文件路径, 必须是.lnk结尾 | |
| lnkpath = WScript.Arguments(0) | |
| ' 目标文件路径 | |
| targetpath = WScript.Arguments(1) |
| #!/bin/bash | |
| # put old cron to file | |
| crontab -l > tmpcron.txt | |
| s=`crontab -l | grep '/root/dropbox.py start'` | |
| # echo "$s"x | |
| if [[ -z "$s" ]]; then | |
| echo "00 04 * * * /root/dropbox.py start" >> tmpcron.txt |
| :: 设置静态ip 192.168.1.246 子网掩码255.255.255.0 网关 192.168.1.1 | |
| netsh interface ip set address 本地连接 static 192.168.1.246 255.255.255.0 192.168.1.1 1 | |
| :: 设置动态ip | |
| netsh interface ip set address 本地连接 dhcp |
| // http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/package.html#encodeURIComponent() | |
| void hexchar(unsigned char c, unsigned char &hex1, unsigned char &hex2) | |
| { | |
| hex1 = c / 16; | |
| hex2 = c % 16; | |
| hex1 += hex1 <= 9 ? '0' : 'a' - 10; | |
| hex2 += hex2 <= 9 ? '0' : 'a' - 10; |
| #!/usr/bin/python | |
| # coding=utf-8 | |
| import os, os.path | |
| import gzip, zipfile | |
| print zipfile.is_zipfile("test.zip") | |
| f = zipfile.ZipFile("test.zip") |
| // 使用混合做遮罩 | |
| CCSize size = m_pMask->getContentSize(); | |
| CCRenderTexture *renderTexture = CCRenderTexture::create(size.width, size.height); | |
| // 设置默认颜色 | |
| renderTexture->setClearColor(ccc4f(0, 0, 0, 0)); | |
| // 设置清除颜色标记,否则autoDraw时不能清除颜色 | |
| renderTexture->setClearFlags(GL_COLOR_BUFFER_BIT); | |
| ccBlendFunc func = { GL_ZERO, GL_SRC_ALPHA }; | |
| m_pMask->setBlendFunc(func); |