Skip to content

Instantly share code, notes, and snippets.

View ifarbod's full-sized avatar
🙃
I'm a jack of all trades

iFarbod ifarbod

🙃
I'm a jack of all trades
View GitHub Profile
@ifarbod
ifarbod / a_spec.pwn
Created July 6, 2014 15:16
SetPlayerSpectatePlayer Function.
// We need some fuctions.
#include <a_samp>
// Declaring a var for checking a player is spectating which player.
new
gSpecTarget[MAX_PLAYERS] = INVALID_PLAYER_ID;
// An enum. For storing player pos (x, y, z)
enum E_PLAYER_POS
{
@ifarbod
ifarbod / loopstest.pwn
Created September 3, 2014 17:18
A Small snippet for testing two ways of loops
#include <a_samp>
#define ITERS (10000000)
main()
{
new
ticks = GetTickCount();
for(new i = 0; i < ITERS; i++)
{
<?php
$doc = file_get_contents('http://opensource.spotify.com/cefbuilds/index.html');
$pattern = '/href="cef_binary_[0-9].[0-9]+.[0-9]+.[a-zA-Z0-9]+_windows32_minimal.tar.bz2"/';
$cefpath = 'http://opensource.spotify.com/cefbuilds/';
preg_match($pattern, $doc, $matches);
$cefbuildnum = $matches[0];
$cefbz = substr($cefbuildnum, 6, strlen($cefbuildnum) - 7);
<?php
$doc = file_get_contents('http://opensource.spotify.com/cefbuilds/index.html');
$pattern = '/href="cef_binary_[0-9].[0-9]+.[0-9]+.[a-zA-Z0-9]+_windows32_minimal.tar.bz2"/';
$cefpath = 'http://opensource.spotify.com/cefbuilds/';
preg_match($pattern, $doc, $matches);
$cefbuildnum = $matches[0];
$cefbz = substr($cefbuildnum, 6, strlen($cefbuildnum) - 7);
// PosX, PosY, PosZ, Angle, CarModelID (-1 for random id), PrimCol (-1 for random id), SecCol (-1 for random id), ForceSpawn, Alarm, DoorLock, Unknown1, Unknown2
static const CarGens meow[] = {
-166.00400, 1013.29999, 18.79200, 314.16, -1, -1, -1, 0, 0, -1, -1
-31.93950, 962.56097, 18.78130, 314.16, 478, -1, -1, 0, 0, -1, -1
70.77970, 1000.19000, 13.52320, 314.16, 543, -1, -1, 0, 0, -1, -1
-101.39900, 887.74902, 19.52740, 314.16, -1, -1, -1, 0, 0, -1, -1
-154.69200, 871.55200, 17.51540, -157.08, -1, -1, -1, 0, 0, -1, -1
-4.19316, 957.39001, 18.81490, -174.53, -1, -1, -1, 0, 0, -1, -1
@ifarbod
ifarbod / CTN_CLA.md
Last active May 30, 2017 18:30
CTNorth Individual Contributor License Agreement.

CTNorth Individual Contributor License Agreement

Thank you for your interest in contributing to open source software projects (“Projects”) made available by CTNorth Team or its affiliates (“CTNorth”). This Individual Contributor License Agreement (“Agreement”) sets out the terms governing any source code, object code, bug fixes, configuration changes, tools, specifications, documentation, data, materials, feedback, information or other works of authorship that you submit or have submitted, in any form and in any manner, to CTNorth in respect of any of the Projects (collectively “Contributions”). If you have any questions respecting this Agreement, please contact opensource@projectctn.com.

You agree that the following terms apply to all of your past, present and future Contributions. Except for the licenses granted in this Agreement, you retain all of your right, title and interest in and to your Contributions.

Copyright License. You hereby grant, and agree to grant, to CTNorth a non-exclusive, pe

#include <Windows.h>
#include <iostream>
#include <string>
#include <cstdint>
#include <vector>
#include <tchar.h>
#include <stdio.h>
struct IplInstEntry
{
// TimecycConverter.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <cstdint>
struct TColour
{
uint32_t bRed;
uint32_t bGreen;
function findRotation(x1,y1,x2,y2)
local t = -math.deg(math.atan2(x2-x1,y2-y1))
if t < 0 then t = t + 360 end;
return t;
end
@ifarbod
ifarbod / find_dxsdk.lua
Created March 15, 2017 23:46
look for dxsdk
-- just do 'dofile()' on this and call the functions
-- should correct the legacy dx sdk fine on most systems
--require "utils"
--included here:
function os.file_exists(name)
local f = io.open(name, "r")
if f ~= nil then
io.close(f)