Skip to content

Instantly share code, notes, and snippets.

View qaisjp's full-sized avatar
🧪
why has the new github hidden statuses?

Qais Patankar qaisjp

🧪
why has the new github hidden statuses?
View GitHub Profile
# Generate a 440 Hz square waveform in Pygame by building an array of samples and play
# it for 5 seconds. Change the hard-coded 440 to another value to generate a different
# pitch.
#
# Run with the following command:
# python pygame-play-tone.py
from array import array
from time import sleep
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;
}
$(".course.sortable > tbody > tr").each((_, o) => {console.log(
$(o).children().eq(1).text(),
$(o).children().eq(2).text(),
$(o).children().eq(0).text()
)
})
@qaisjp
qaisjp / camera-logic.lua
Last active November 11, 2017 10:11
sort of lua for camera logic
-- 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
@qaisjp
qaisjp / schema.sql
Created July 29, 2018 17:03
quickfox schema
--
-- 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 / unifdef.py
Created September 14, 2018 15:48
Python script to remove include guards from files. It also leaves files with exactly one trailing newline.
#! /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'.")
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

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:

@qaisjp
qaisjp / deploy-cv.gs
Created June 26, 2019 12:54
Set "onOpen" as the default function. Provide a script property "pdf" with value = the file ID of your pdf document
function onOpen() {
var ss = DocumentApp.getUi();
ss.createMenu("qais.jp/cv")
.addItem("Deploy this", "actionDeploy")
.addToUi();
};
function getPDFFile() {
const id = PropertiesService.getScriptProperties().getProperty("pdf");
@qaisjp
qaisjp / README.md
Created August 6, 2019 00:17
Lock Screen Complex Modification

Karabiner Elements - Lock Screen Complex Modification

This allows you to do Cmd+Shift+X at any time to trigger a screen lock.

You can actually do this natively by setting up an Automator script, but that won't work in programs that manually bind to that key combination (e.g. Slack, for strikethrough).

(Doing it with Karabiner Elements will override any existing keybind.)

How to install