Skip to content

Instantly share code, notes, and snippets.

View Ruzzz's full-sized avatar

Ruslan Zaporojets Ruzzz

View GitHub Profile
:: Contact: ruzzzua@gmail.com
:: Version: 2015.08.25
:: Dependencies: Android Debug Bridge (adb), IDA
@echo off
set path="c:\Program Files\Android\android-sdk\platform-tools\";%path%
set port=23946
adb push android_server /system/xbin/android_server
adb shell chmod 06755 /system/xbin/android_server
@Ruzzz
Ruzzz / speed_limit.php
Last active October 12, 2015 21:18
Php | Test | Speed limit
<?php
$filename = $_GET['file'];
$downloadRate = isset($_GET['speed']) ? intval($_GET['speed']) : 500;
if (file_exists($filename) && is_file($filename))
{
header('Cache-control: private');
header('Content-Type: application/x-shockwave-flash'); // Set MIME
header('Content-Length: '.filesize($filename));
@Ruzzz
Ruzzz / encode_dom_to_url.js
Created November 16, 2012 19:11
Encode DOM to URL
(function () {
// From http://www.webtoolkit.info/javascript-base64.html
var Base64 = {
_keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
encode : function (input) {
var output = "";
var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
@Ruzzz
Ruzzz / fast_x86_math_func.c
Created November 16, 2012 19:32
Быстрые мат. функции на си (нашел где-то)
int floor(float a)
{
int b = (int)a;
if (a >= 0 || (a - b) == 0)
return b;
else
return b - 1;
}
int trunc(float r)
@Ruzzz
Ruzzz / AStyle_for_Notepade++_and_VS.txt
Last active October 12, 2015 21:38
My AStyle Settings (Notepade++,Visual Studio)
See http://sourceforge.net/projects/astyle/
Notepade++
Script for NppExec:
NPP_SAVE
cd $(CURRENT_DIRECTORY)
с:\apps\dev\AStyle\AStyle.exe -A1 -s4 -S -w -Y -m0 -M120 -p -H -U -k3 -W3 -xj -c -xy -Z -z1 "$(FILE_NAME)"
Visual Studio
@Ruzzz
Ruzzz / GoogleClosureCompiler_for_Notepade++.txt
Last active October 12, 2015 21:39
Google Closure Compiler for Notepade++
Script for NppExec:
NPP_SAVE
cd $(CURRENT_DIRECTORY)
java -jar f:\apps\dev\GoogleClosureCompiler\compiler.jar --js "$(FILE_NAME)" --js_output_file "$(NAME_PART)_min$(EXT_PART)"
@Ruzzz
Ruzzz / min_win32_gui_app.cpp
Created November 16, 2012 20:01
Minimal Windows GUI Program
#include <windows.h>
static TCHAR szWindowClass[] = TEXT("MinAppWindowClass");
static TCHAR szTitle[] = TEXT("Min App");
HINSTANCE hInst;
HWND hWnd;
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
@Ruzzz
Ruzzz / get_version.bat
Created March 30, 2013 17:39
Read and return version of project from string #define VERSION "_VER_"
@echo off
rem Init
set ROOT_PATH=%~dp0..\..
rem get #define VERSION "_VER_"
for /f "tokens=* delims= " %%a in (%ROOT_PATH%\src\defs.h) do (
echo %%a | find "VERSION" > nul
if not errorlevel 1 set LINE=%%a
)
{
"shell_cmd": "g++.exe \"${file}\" -O2 -std=c++0x -s -static -o \"${file_path}\\\\${file_base_name}\"",
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"path" : "%PATH%;c:\\mingw32\\bin\\",
"working_dir": "${file_path}",
"selector": "source.c, source.c++, source.cpp",
"variants":
[
{
"name": "Run",
{
"env" :
{
"CL_PARAMS" : "/O2 /W3 /GL /MT /GS /EHsc /D \"NDEBUG\" /D \"_UNICODE\" /D \"UNICODE\" /D \"WIN32_LEAN_AND_MEAN\" /D \"WIN32\" /D \"_WINDOWS\"",
"LINK_PARAMS" : "/link /OPT:REF /SUBSYSTEM:CONSOLE",
"EXE_SUFIX" : "_x64.exe"
},
"path" : "%PATH%;%ProgramFiles(x86)%\\microsoft visual studio 11.0\\vc",
"shell_cmd": "vcvarsall.bat amd64 && cl.exe %CL_PARAMS% \"${file}\" %LINK_PARAMS% /OUT:\"${file_base_name}%EXE_SUFIX%\" && del *.obj",