Skip to content

Instantly share code, notes, and snippets.

View onewoorks's full-sized avatar
🏠
Working from home

irwan ibrahim onewoorks

🏠
Working from home
View GitHub Profile
@onewoorks
onewoorks / wasaptext.html
Created August 7, 2023 06:09
Basic form to wassap message builder
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<title>Test</title>
</head>
<body>
@onewoorks
onewoorks / print-badge
Created June 16, 2020 08:56 — forked from gelin/print-badge
Python script to print a badge to a thermal printer with TSPL language (by TSC)
#!/usr/bin/env python3
PRINTER = '/dev/usb/lp0' # the printer device
DOTS_MM = 8 # printer dots per mm, 8 == 203 dpi
WIDTH_MM = 100 # sticker width, mm
HEIGHT_MM = 35 # sticker height, mm
GAP_MM = 2 # sticker gap, mm
FONT = "0" # built-in vector font, scalable by X and Y
@onewoorks
onewoorks / nginxproxy.md
Created May 19, 2020 09:20 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@onewoorks
onewoorks / App.js
Created February 12, 2020 03:08 — forked from fdidron/App.js
React Router v4 Auth
//Usage
import React from 'react';
import { BrowserRouter as Router } from 'react-router-dom';
import Route from './AuthRoute';
import Login from './Login';
import Private from './Private';
export default () =>
<Router>
@onewoorks
onewoorks / gist:af98be62a7a44de6d7febe6622533180
Created February 4, 2020 02:42
pip3: command not found
This utility should have been installed as part of the Python 3 installation. Check if Python 3 is installed by running python3 --version. If it is not installed, download it here.
If you are able to successfully run python3 --version but not pip3, install Home Assistant by running the following command instead:
$ python3 -m pip install homeassistant
Bash
On a Debian system, you can also install python3 by sudo apt-get install python3 and pip3 by sudo apt-get install python3-pip.
If you run into errors during installation, check that you’ve installed all the necessary prerequisite packages, which include python3-dev, libffi-dev, and libssl-dev. On a Debian-based system, you can install these via apt-get:
const redux = require('redux')
const createStore = redux.createStore
const initialState = {
value: 0,
age: 17
}
// 2. reducer -- laluan untuk update value dalam store
const rootReducer = (state = initialState, action) => {
@onewoorks
onewoorks / message.py
Last active December 10, 2019 02:25
whatsapp messenger
from time import sleep
from selenium.webdriver.common.by import By
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.support.ui import WebDriverWait
import socket
message_text='Sample sender script to unsave number' # message you want to send
@onewoorks
onewoorks / gist:be0022e065ed1378154b41ea9f880a90
Created September 14, 2019 23:42
chartjs tab navigation way around (dirty solution)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Entrance & Exit Survey</title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
var dbConn;
var result;
var paramList;
var content = {};
var table;
var column;
var pat_id;
var json = {};
var minimumURLParameterCount = 3;
@onewoorks
onewoorks / certificate.sh
Created October 5, 2017 08:35 — forked from WebReflection/certificate.sh
A basic Self Signed SSL Certificate utility
#!/usr/bin/env bash
# A basic Self Signed SSL Certificate utility
# by Andrea Giammarchi @WebReflection
# https://www.webreflection.co.uk/blog/2015/08/08/bringing-ssl-to-your-private-network
# # to make it executable and use it
# $ chmod +x certificate
# $ ./certificate # to read the how-to