Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View tbhaxor's full-sized avatar
👨‍🚀
Exploring nature beyond Kármán line

Gurkirat Singh tbhaxor

👨‍🚀
Exploring nature beyond Kármán line
View GitHub Profile
var DAY;
(function (DAY) {
DAY[DAY["SUNDAY"] = 0] = "SUNDAY";
DAY[DAY["MONDAY"] = 1] = "MONDAY";
DAY[DAY["TUESDAY"] = 2] = "TUESDAY";
DAY[DAY["WEDNESDAY"] = 3] = "WEDNESDAY";
DAY[DAY["THURSDAY"] = 4] = "THURSDAY";
DAY[DAY["FRIDAY"] = 5] = "FRIDAY";
DAY[DAY["SATURDAY"] = 6] = "SATURDAY";
})(DAY || (DAY = {}));
@tbhaxor
tbhaxor / tsconfig.json
Created March 5, 2019 10:32
Sample TypeScript Config
{
"compilerOptions": {
/* Basic Options */
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
// "lib": [], /* Specify library files to be included in the compilation. */
// "allowJs": true, /* Allow javascript files to be compiled. */
// "checkJs": true, /* Report errors in .js files. */
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
// "declaration": true, /* Generates corresponding '.d.ts' file. */
@tbhaxor
tbhaxor / hello-world.cpp
Created March 5, 2019 18:09
Ncurses : Hello World
#include <ncurses.h>
using namespace std;
int main(int argc, char ** argv)
{
// init screen and sets up screen
initscr();
// print to screen
printw("Hello World");
@tbhaxor
tbhaxor / cursor.cpp
Created March 5, 2019 18:29
Cursors
#include <ncurses.h>
using namespace std;
int main (int argc, char ** argv)
{
initscr();
// moving cursor, x = 10, y = 20
move(20, 10);
@tbhaxor
tbhaxor / windows.cpp
Created March 5, 2019 18:57
Windows in ncurses
#include <ncurses.h>
using namespace std;
int main(int argc, char **argv)
{
initscr();
// creating a window;
// with height = 15 and width = 10
// also with start x axis 10 and start y axis = 20
@tbhaxor
tbhaxor / attributes.cpp
Created March 5, 2019 19:09
Setting / Unsetting attributes
#include <ncurses.h>
using namespace std;
int main(int argc, char const *argv[])
{
initscr();
cbreak();
// checking is terminal supports color
if (!has_colors())
@tbhaxor
tbhaxor / userinput.cpp
Created March 11, 2019 18:34
Get user input in ncurses
#include <cstdlib>
#include <cstring>
#include <ncurses.h>
#include <iostream>
using namespace std;
int main()
{
// setting up string
@tbhaxor
tbhaxor / Bojack.py
Created March 23, 2019 20:02
X-MAS CTF 2018
# Bojack.py
from PIL import Image
import binascii
import string
def rgb2hex(r,g,b):
hex = "#{:02x}{:02x}{:02x}".format(r,g,b)
return str(hex)
im = Image.open('bojack.png')
print im
arr=''
self.webView = QtWebKitWidgets.QWebView(self)
request = QtNetwork.QNetworkRequest()
request.setUrl(QtCore.QUrl("http://website.tk/"))
request.setRawHeader(b"User-Agent", b"US3RAGENT-$405$Application/NIMBUS")
self.webView.load(request)
self.webView.setGeometry(QtCore.QRect(0, 0, self.width(), self.height()))
self.webView.show()
@tbhaxor
tbhaxor / col.c
Created April 19, 2019 05:48
pwnable.kr ctf
#include <stdio.h>
#include <string.h>
unsigned long hashcode = 0x21DD09EC;
unsigned long check_password(const char* p){
int* ip = (int*)p;
int i;
int res=0;
for(i=0; i<5; i++){
res += ip[i];
}