Skip to content

Instantly share code, notes, and snippets.

View elaoshi's full-sized avatar

elaoshi

View GitHub Profile
"""
Copyright (C) 2018 Interactive Brokers LLC. All rights reserved. This code is subject to the terms
and conditions of the IB API Non-Commercial License or the IB API Commercial License, as applicable.
"""
import sys
from ibapi.contract import *
@elaoshi
elaoshi / escpos-command.txt
Created January 12, 2022 03:33 — forked from tuantmdev/escpos-command.txt
ESC/POS Command
# Printer hardware
HW_INIT = [ 0x1b, 0x40 ] # Clear data in buffer and reset modes
HW_SELECT = [ 0x1b, 0x3d, 0x01 ] # Printer select
HW_RESET = [ 0x1b, 0x3f, 0x0a, 0x00 ] # Reset printer hardware
# Feed control sequences
CTL_LF = [ 0x0a ] # Print and line feed
CTL_FF = [ 0x0c ] # Form feed
CTL_CR = [ 0x0d ] # Carriage return
CTL_HT = [ 0x09 ] # Horizontal tab
@elaoshi
elaoshi / nginx.conf
Created November 2, 2021 03:04
RabbitMQ / NGINX
user lbakken lbakken;
worker_processes 1;
# Note: for debugging, very useful
# error_log /dev/stderr debug;
error_log /dev/stderr;
pid nginx.pid;
worker_rlimit_nofile 1024;
daemon off;
events {
@elaoshi
elaoshi / gravity_forms_webhook_example_suitecrm.php
Created March 21, 2021 04:08 — forked from mrbarletta/gravity_forms_webhook_example_suitecrm.php
Gravity Forms Webhook example - Posting data to SuiteCRM/SugarCRM/LionixCRM - working example
<?php
// Add the following code to your theme functions.php (not recommended as might get lost on updates) or create a plugin
//LX - CRM
add_action( 'gform_after_submission', 'post_to_crm', 10, 2 );
function post_to_crm( $entry, $form ) {
$post_url = 'https://youInstance.lionix.com/index.php?entryPoint=WebToPersonCapture';
$post=false;
//Gravity forms has IDs for each of the fields . Some fields, like 1.3, means FIELD 1, subfield 3. Which usually means first_name