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
@qaisjp
qaisjp / todo.md
Last active August 25, 2019 15:13

Stuff to add to "Changes to 1.5.7" wiki page

This only goes up to 680f14d48c861f012b4864d27d11740123d5d39e

Fixes

AddReportLog(1003, SString("CInstallManager::_ChangeToAdmin - exit(0) %s", ""));
AddReportLog(1041, SString("* Launch * pid:%d '%s' MTASAPath set from %s '%s'", dwProcessId, GetLaunchPathFilename().c_str(), GotPathFrom.c_str(),
AddReportLog(1044, SString("* End (0x%X)* pid:%d", iReturnCode, GetCurrentProcessId()));
AddReportLog(1060, SString("CInstallManager::Continue - return %s", *strCommandLineOut));
AddReportLog(1061, SString("CInstallManager::RestoreSequencerState %s", *strText));
AddReportLog(1062, SString("GetLauncherPathFilename %s", *strResult));
AddReportLog(1070, SString("CallFunction: %s", *strName));
AddReportLog(2005, SString("DoPollDownload: Downloaded %d bytes from %s", m_JobInfo.downloadBuffer.size(), m_strLastQueryURL.c_str()));
AddReportLog(2007, SString("DoPollDownload: Downloaded %s", m_JobInfo.strSaveLocation.c_str()));
AddReportLog(2050, SString("_InstallFiles: ok %s", ""));
@qaisjp
qaisjp / launch.json
Last active October 29, 2019 01:49
Computer Graphics - VS Code configuration
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "build and debug project",
"type": "cppdbg",
"request": "launch",

In the exam:

  • use git config --global color.ui auto
  • Remember /opt/agda/agda-stdlib-1.1 (the /opt/agda path can be derived from agda-mode locate)
  • grep --color=always -R "foldr" . | less -r
class Solution:
# Suitable ranges for:
# - HH is 00 to 23
# - MM is 00 to 59
def num_to_digits(self, n):
s = list(map(int, list(str(n))))
if n < 10:
return [0, s[0]]
return s
@qaisjp
qaisjp / qaisjp-robbynew.zsh-theme
Last active November 11, 2019 13:56
The zsh theme that I use, based on robbyrussell. I was very creative when I hopped over to zsh, and named it "robbynew".
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )"
# You may choose to remove %n@ vv here!
PROMPT='%{$fg_bold[green]%}%n@%m:%{$fg[cyan]%} %~%{$reset_color%} $(git_prompt_info)
${ret_status}%{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
@qaisjp
qaisjp / ssl.c
Last active December 7, 2019 21:34
Do not delete - used in Better Informatics, Secure Programming, 2014 May
static OSStatus
SSLVerifySignedServerKeyExchange(SSLContext * ctx,
bool isRsa, SSLBuffer signedParams,
uint8_t * signature, UInt16 signatureLen)
{
OSStatus err;
SSLBuffer hashOut, hashCtx, clientRandom, serverRandom;
uint8_t hashes[SSL_SHA1_DIGEST_LEN + SSL_MD5_DIGEST_LEN];
SSLBuffer signedHashes;
uint8_t * dataToSign;
@qaisjp
qaisjp / import.sh
Last active March 8, 2020 19:31
go-discord-irc upload script
#!/usr/bin/env bash
#
# Usage: GOOS=linux go build && ssh discord.tardis ./replace.sh < go-discord-irc
set -u
set -e
target=$(tempfile)
echo "Copying file to \"$target\""
➜ ./suitup/app.py
----------
Statistics
----------
- 324 naked methods found
- 139 naked methods with non-asm found
- Completion: 57.10%
CODE File Method Context
https://discordapp.com/channels/315277951597936640/315277951597936640/687341476883202066
[19:59] qaisjp: note to self; stop testing in production
[20:09] Simon: a custom ircd could avoid sending any join/parts except to the main bot
[20:09] Simon: although for 1000 users it'd be better to use the s2s protocol
[20:10] Simon: which ideally needs a completely robust pretend server that doesn't do odd things
[20:10] qaisjp: I think that was our second idea wasn't it? Custom ircd?
[20:10] qaisjp: Or at least a second idea that was had for a different bridge
[20:11] qaisjp: What's the S2S protocol?
[20:11] qaisjp: Server to server
[20:11] Simon: it was the first idea but then I decided it would be easier to let you connect multiple times