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

Notes on the first session (the big one)

EdinburghID

People grouped up the following services into one:

  • Card services
  • change your password
  • set up your email account
@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
$(".course.sortable > tbody > tr").each((_, o) => {console.log(
$(o).children().eq(1).text(),
$(o).children().eq(2).text(),
$(o).children().eq(0).text()
)
})
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 February 25, 2017 18:31
Some magnificently shite code
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];

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:

I don't know if we've been taught the general method for De Morgan's, but I'll say it anyway:

  • NOT the whole sentence
  • NOT each item in the brackets (direct children only)
  • INVERT each AND/OR. This makes AND become OR, and vice-versa (direct children only)

When I say direct children only, I mean that if you have (A or (B and C)), you should end up with not (not A and not (B and C)) by De Morgan's.

You should NOT end up with not (not A and (not B or not C)).

Keybase proof

I hereby claim:

  • I am qaisjp on github.
  • I am qaisjp (https://keybase.io/qaisjp) on keybase.
  • I have a public key whose fingerprint is 5D90 87F0 7DC7 E6CB 1CE0 814A 39A7 A845 3517 B0FD

To claim this, I am signing this object:

@qaisjp
qaisjp / tut2 ex4.hs
Last active October 9, 2016 14:58 — forked from Fasand/tut2 ex4
lookUp :: Char -> [(Char, Char)] -> Char
lookUp needle xs = if (null selected) then needle else snd $ selected !! 0
where
selected = [x | x <- xs, fst x == needle]
@qaisjp
qaisjp / dubtrack.swagger.yaml
Last active May 1, 2016 17:15
dubtrack fm swagger yaml docs
swagger: '2.0'
info:
title: Dubtrack API
description: |
Unofficial documentation. All responses are wrapped in `{ code: 200, data: <response>, message: "OK" }`.
version: "1.0.0"
# the domain of the service
host: api.dubtrack.com
# array of all schemes that your API supports