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 / velo2.patch
Created November 22, 2014 16:51
mtasa-blue patch for oop velocities
Index: MTA10/mods/shared_logic/lua/CLuaMain.cpp
===================================================================
--- MTA10/mods/shared_logic/lua/CLuaMain.cpp (revision 6938)
+++ MTA10/mods/shared_logic/lua/CLuaMain.cpp (working copy)
@@ -163,7 +163,7 @@
lua_classfunction ( luaVM, "getPosition", CLuaOOPDefs::GetElementPosition );
lua_classfunction ( luaVM, "getRotation", CLuaOOPDefs::GetElementRotation );
lua_classfunction ( luaVM, "getMatrix", CLuaOOPDefs::GetElementMatrix );
- lua_classfunction ( luaVM, "getVelocity", "getElementVelocity" );
+ lua_classfunction ( luaVM, "getVelocity", CLuaOOPDefs::GetElementVelocity );
@qaisjp
qaisjp / edf.patch
Last active August 29, 2015 14:12
Patch for [editor]/editor_gui/client/elementproperties.lua and [editor]/edf/edf.lua
Index: edf/edf.lua
===================================================================
--- edf/edf.lua (revision 1024)
+++ edf/edf.lua (working copy)
@@ -408,7 +408,7 @@
for dataField, dataDefinition in pairs(elementDefinition.data) do
local checkedData = edfCheckElementData(theElement, dataField, dataDefinition)
if checkedData == nil then
- outputDebugString('Failed validation for ' .. elementType .. '!' .. dataField)
+ exports.editor_gui:outputMessage("Unable to create element; validation failed for "..elementType.."!"..dataField)
@qaisjp
qaisjp / uwot.patch
Last active August 29, 2015 14:13
radar area rectangle flash f11 map
Index: MTA10/mods/deathmatch/_Deathmatch 2008.vcproj
===================================================================
--- MTA10/mods/deathmatch/_Deathmatch 2008.vcproj (revision 7004)
+++ MTA10/mods/deathmatch/_Deathmatch 2008.vcproj (working copy)
@@ -1266,6 +1266,10 @@
RelativePath="..\shared_logic\lua\oopdefs\CLuaOOPFunctionDefs.Drawing.cpp"
>
</File>
+ <File
+ RelativePath="..\shared_logic\lua\oopdefs\CLuaOOPFunctionDefs.RadarArea.cpp"
local sounds = {
"hello.mp3",
"2a.mp3",
"a.as.mp3",
"ahe.wav"
}
local currentNumber;
addCommandHandler("startPlaylist", function()
@qaisjp
qaisjp / 1.vba
Last active August 29, 2015 14:16
Project Euler Solutions (in VB, because why not?) (Not that I would encourage you to use VB, of course)
Module Module1
Sub Main()
Dim maxNumber As Integer = 1000
Dim value As Integer = 0
For i As Integer = 1 To maxNumber - 1
If (i Mod 3 = 0) Or (i Mod 5 = 0) Then
value += i
End If
Next
@qaisjp
qaisjp / Employee.vb
Last active November 26, 2015 07:04
A2 AQA Computing | Section 2.1: Programming paradigms | Exercises in OOP programming | Exercise 2
Public Class Employee
' These private variables cannot be accessed outside the class
' This means that in Module1.vb, we can't do emp.EmployeeID
' The only time we really need to do this is when validating data
' See the comments for each function to see how they *could* be validated
Private EmployeeID As String
Private DateOfBirth As String
Private JobTitle As String
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
@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
@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]

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:

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)).