Skip to content

Instantly share code, notes, and snippets.

Avatar
🧪
why has the new github hidden statuses?

Qais Patankar qaisjp

🧪
why has the new github hidden statuses?
View GitHub Profile
@qaisjp
qaisjp / challenge.java
Last active Aug 29, 2015
A digital sum is the sum of all of the digits in a number so 214123 = 2+1+4+1+2+3 = 13 - The Tower of Hanoi puzzle involves moving disks in a certain order. What is digital sum of the number of required moves to solve 500000-disk Tower of Hanoi puzzle?
View challenge.java
package demoproject;
import java.math.BigInteger;
public class blah {
public static void main(String[] args) {
BigInteger big = BigInteger.valueOf(2).pow(500000).subtract(BigInteger.ONE);
String[] num = big.toString().split("(?!^)");
int number = 0;
View GitHub-HQ.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@qaisjp
qaisjp / classlib.lua
Created Apr 23, 2014
MTA Libs: classlib
View classlib.lua
-- Developer: sbx320
-- License: MIT
-- Github Repos: https://github.com/sbx320/lua_utils
--// classlib
--|| @type: Shared
--|| @desc: A library providing several tools to enhance OOP with Lua
--|| @info: Registers itself into the global namespace
--\\
local elementClasses = {}
@qaisjp
qaisjp / emptyfiles.sh
Last active Aug 29, 2015
A little script that enumerates all files in the current folder recursively and does something to each file
View emptyfiles.sh
# replaces the contents with "$FILENAME\n======" (representing a markdown header with the filename).
find . -type f -exec sh -c 'printf "$1 \n======" > "$1"' sh {} \;
# append extension ".md"
find . -type f -exec sh -c 'mv "$1" "$1.md"' sh {} \;
View pathfinding.go
package main
import (
"io/ioutil"
"log"
"os"
"path"
"strings"
)
View gist:4fdfc2317b62fdcf328a
-- Developer: sbx320
-- License: MIT
-- Github Repos: https://github.com/sbx320/lua_utils
--// classlib
--|| A library providing several tools to enhance OOP with MTA and Lua
--\\
SERVER = triggerServerEvent == nil
CLIENT = not SERVER
DEBUG = DEBUG or false
@qaisjp
qaisjp / velo2.patch
Created Nov 22, 2014
mtasa-blue patch for oop velocities
View velo2.patch
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 Aug 29, 2015
Patch for [editor]/editor_gui/client/elementproperties.lua and [editor]/edf/edf.lua
View edf.patch
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 Aug 29, 2015
radar area rectangle flash f11 map
View uwot.patch
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"
View sound.c.lua
local sounds = {
"hello.mp3",
"2a.mp3",
"a.as.mp3",
"ahe.wav"
}
local currentNumber;
addCommandHandler("startPlaylist", function()