View copyDeps.gradle
apply plugin: 'com.android.application' | |
android.applicationVariants.all { variant -> | |
task "copyDependencies${variant.name.capitalize()}"() { | |
outputs.upToDateWhen { false } | |
doLast { | |
println "Executing copyDependencies${variant.name.capitalize()}" | |
variant.getCompileClasspath().each { fileDependency -> | |
def sourcePath = fileDependency.absolutePath | |
def destinationPath = project.projectDir.path + "/build/dependencies/${variant.name}/" |
View bakts.bat
@ECHO OFF | |
for /f %%a in ('time_stamp.exe') do (set ts=%%a) | |
copy %1 %1.%ts%.bak |
View simple-https-server.py
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/ | |
# generate server.xml with the following command: | |
# openssl req -new -x509 -keyout key.pem -out server.pem -days 365 -nodes | |
# run as follows: | |
# python simple-https-server.py | |
# then in your browser, visit: | |
# https://localhost:4443 | |
import BaseHTTPServer, SimpleHTTPServer | |
import ssl |
View simple-https-server.py
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/ | |
# generate server.xml with the following command: | |
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes | |
# run as follows: | |
# python simple-https-server.py | |
# then in your browser, visit: | |
# https://localhost:4443 | |
import BaseHTTPServer, SimpleHTTPServer | |
import ssl |
View hello_csharp.cmd
/* This section is run in batch file mode | |
@echo off | |
REM Based on http://stackoverflow.com/a/13485357 | |
SETLOCAL ENABLEEXTENSIONS | |
if not exist %0.exe ( | |
for /f "usebackq tokens=1,3 delims= " %%A in (`REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP" /s /e /f InstallPath 2^>nul ^| findstr InstallPath ^| sort /R`) do ( | |
set FrameworkDir=%%B | |
goto :found | |
) | |
:found |
View keepawake.py
import time | |
import sys | |
import os | |
import ctypes | |
ES_CONTINUOUS = 0x80000000 | |
ES_AWAYMODE_REQUIRED = 0x00000040 | |
ES_SYSTEM_REQUIRED = 0x00000001 | |
ES_DISPLAY_REQUIRED = 0x00000002 |
View teets.bat
@ECHO OFF | |
for /f %%a in ('timestamp.exe') do (set ts=%%a) | |
tee %* log_%ts%.log |
View hexdump.py
def hexdump( src, length=16, sep='.' ): | |
''' | |
@brief Return {src} in hex dump. | |
@param[in] length {Int} Nb Bytes by row. | |
@param[in] sep {Char} For the text part, {sep} will be used for non ASCII char. | |
@return {Str} The hexdump | |
@note Full support for python2 and python3 ! | |
''' | |
result = []; |
View bakts.bat
@ECHO OFF | |
for /f %%a in ('timestamp.exe') do (set ts=%%a) | |
copy /V "%1" "%1.%ts%.bak" |
View timestamp.c
#include <stdio.h> | |
#include <time.h> | |
/* | |
@ECHO OFF | |
for /f %%a in ('timestamp.exe') do (set ts=%%a) | |
echo %ts% | |
*/ | |
int main(int argc, char **argv) |
NewerOlder