Skip to content

Instantly share code, notes, and snippets.

View gfreivasc's full-sized avatar

Gabriel Freitas Vasconcelos gfreivasc

View GitHub Profile
.text:004010B0 sub_4010B0 proc near ; CODE XREF: sub_401120+24p
.text:004010B0 push esi
.text:004010B1 mov esi, ecx
.text:004010B3 push esi
.text:004010B4 call ds:rand
.text:004010BA cdq
.text:004010BB mov ecx, 6
.text:004010C0 idiv ecx
.text:004010C2 shl edx, 4
.text:004010C5 add edx, offset aHello ; "Hello"
@gfreivasc
gfreivasc / worldtoscreen.cpp
Created August 17, 2016 13:15
WorldToScreen 16:9
/**********************************
Credits to OGC for world2screen
**********************************/
inline float VectorAngle(const vec3_t a, const vec3_t b)
{
float length_a = VectorLength(a);
float length_b = VectorLength(b);
float length_ab = length_a*length_b;
if (length_ab == 0.0) { return 0.0; }
@gfreivasc
gfreivasc / vehhook_nc.cpp
Last active September 6, 2016 15:07
VEHHook NoClass
// Credits to @MarkHC
#include <cstdio>
#include <Windows.h>
int add(int a, int b)
{
return a + b;
}
int mul(int a, int b)
@gfreivasc
gfreivasc / astar.cpp
Last active September 17, 2016 17:42
#include <cstdio>
#include <queue>
#include <unordered_map>
#include <vector>
#include <algorithm>
using namespace std;
#ifndef _DEBUG
#define _DEBUG
import scrapy
class MinimalSpider(scrapy.Spider):
name = 'minimal'
start_urls = ['http://gabrielfv.com/']
def parse(self, response):
data = {}
data['title'] = response.css('title::text').extract_first()
@gfreivasc
gfreivasc / BackgroundService.java
Last active July 7, 2022 06:05
A BackgroundService class for Android
package com.gabrielfv.android.engine;
import android.app.Service;
import android.content.Intent;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.IBinder;
import android.os.Looper;
import android.os.Message;
import android.os.PowerManager;
@gfreivasc
gfreivasc / sslbuild-android.sh
Created December 5, 2017 21:10
SSL Build for Android (tested on r16)
#!/bin/bash -e
#@author Gabriel Vasconcelos ([email protected])
#Hints and code taken also from Aleksandar Gotev and http://stackoverflow.com/questions/11929773/compiling-the-latest-openssl-for-android
if [ "$#" -ne 6 ]
then
echo "Usage:"
echo "./openssl-build <ANDROID_NDK_PATH> <OPENSSL_SOURCES_PATH> <ANDROID_TARGET_API> \\"
echo " <ANDROID_TARGET_ABI> <GCC_VERSION> <OUTPUT_PATH>"
echo
# also set the launcher options to
# -novid -tickrate 128 -fullscreen -w 1280 -h 960
unbindall
bind "0" "slot10"
bind "1" "slot1"
bind "2" "slot2"
bind "3" "slot3"
bind "4" "slot4"
bind "5" "slot5"
bind "6" "+jump;-attack;-attack2;"