Skip to content

Instantly share code, notes, and snippets.

🇯🇵
Busy exploring Japan until 1st July

Qais Patankar qaisjp

🇯🇵
Busy exploring Japan until 1st July
Block or report user

Report or block qaisjp

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View mtasa-macos.md

MTA:SA on macOS instructions

Preparation

  1. Download mtasa-1.5.6.exe
  2. Make sure you have the GTA San Andreas folder copied to your computer.
    • You might need a GTA SA 1.00 No CD crack - any HOODLUM release will do.

Install Wine

  1. Make sure you have Homebrew installed.
View infos.slots.md

To answer your question, neither remove_block or insert_block alters the pgd given to it.

So after a bit of reading of the code I think I finally understand why it uses pointers^squared. I hope I haven't overexplained anything but this might help someone. Someone else pls correct me if i'm wrong.

Blocks:

  • Some .. block .. of memory.
  • It's important to remember that a PageDescriptor is not a block itself, and neither is a PageDescriptor*. Read on.

Page Descriptors:

View gist:7ee02d8d06dc41d0bbed7537a7365d18
Page 1: SDP Student Information
1. Please provide your university email address. Required
Please enter a valid email address.
2. Have you done/currently doing the course IVR? Required
Yes
No
3. Briefly describe any internships you have done. (If none write "N.A.") Required
@qaisjp
qaisjp / unifdef.py
Created Sep 14, 2018
Python script to remove include guards from files. It also leaves files with exactly one trailing newline.
View unifdef.py
#! /usr/bin/env python3
import sys, os
def main(args):
if len(args) < 2:
print("./unifdef file1.h file2.h..")
print("Python script to remove include guards from files, and replaces with '#pragma once'.")
@qaisjp
qaisjp / schema.sql
Created Jul 29, 2018
quickfox schema
View schema.sql
--
-- PostgreSQL database dump
--
-- Dumped from database version 9.6.5
-- Dumped by pg_dump version 10.4
-- Started on 2018-07-29 18:00:35 BST
SET statement_timeout = 0;
@qaisjp
qaisjp / camera-logic.lua
Last active Nov 11, 2017
sort of lua for camera logic
View camera-logic.lua
-- Code written by Qais Patankar
-- Placed under the public domain, feel free to use this in your project
--
-- Code is also not real Lua code, it's pseudocode-ish, for easy public consumption.
--
-- This zooms out the camera if players are far apart.
-- All comments were written at time of Gist creation (2017-11-11).
local zoomAccuracy = 0.05
local maxZoom = 0.25
View scrape.js
$(".course.sortable > tbody > tr").each((_, o) => {console.log(
$(o).children().eq(1).text(),
$(o).children().eq(2).text(),
$(o).children().eq(0).text()
)
})
View calum.hgs.club.conf
lua_shared_dict calum_scores 12k;
server {
server_name calum.hgs.club;
listen 80;
default_type text;
add_header 'Access-Control-Allow-Origin' '*';
location / {
return 444;
}
@qaisjp
qaisjp / INF1OP_NoughtsAndCrosses.java
Created Feb 25, 2017
Some magnificently shite code
View INF1OP_NoughtsAndCrosses.java
public class NoughtsAndCrosses {
boolean drawn;
int winner;
public NoughtsAndCrosses(int[][] board) {
// First check all columns
for (int x = 0; x < 3; x++) {
Integer winner = board[x][0];
View autossh-reverse-tunnel.md

Setting up an autossh reverse tunnel

1. Set up sshtunnel user

Follow this tutorial until step five-ish

If the test does not work because of "public key" issues, run sudo passwd sshtunnel on the server to change the password of the user. (If sudo tail -f /var/log/auth.log says the account is locked, this will be the issue.)

authorized_keys should look a little like:

You can’t perform that action at this time.