Skip to content

Instantly share code, notes, and snippets.

View edthix's full-sized avatar
💭
Online

Edham Arief Dawillah / edthix edthix

💭
Online
View GitHub Profile
@edthix
edthix / connect_wifi.py
Created September 17, 2022 07:11
PyCon MY 2022 - sample codes
def do_connect():
import network
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
if not wlan.isconnected():
print('connecting to network...')
wlan.connect('smartspacekk', 'smartspace09')
while not wlan.isconnected():
pass
print('network config:', wlan.ifconfig())
@edthix
edthix / 01.py
Last active August 21, 2021 06:52
Beyond The Moon - Python Codes
# Beyond The Moon - Python Codes
# Workshop Session 1 (Python)
# By Kinabalu Coders
import turtle
# tukar penjuru untuk poligon baru
penjuru = 8
@edthix
edthix / ssh_tunnel_postgres.py
Created December 11, 2019 08:12
Sample airflow dag for ssh tunnel + postgres (assuming both SERVER_ssh_connector and SERVER_ssh_postresql_tunnel_connector are available)
from datetime import timedelta, datetime
import airflow
from airflow import DAG
from airflow.models import Variable
from airflow.contrib.operators.ssh_operator import SSHOperator
from airflow.contrib.hooks.ssh_hook import SSHHook
from airflow.operators.postgres_operator import PostgresOperator
default_args = {
'owner': 'airflow',
<?xml version="1.0" encoding="UTF-8"?>
<Mediainfo
version="0.1"
ref="sources/234p_0.ts">
<File>
<track type="General">
<Count>324</Count>
<Count_of_stream_of_this_kind>1</Count_of_stream_of_this_kind>
<Kind_of_stream>General</Kind_of_stream>
<Kind_of_stream>General</Kind_of_stream>
<?xml version="1.0" encoding="UTF-8"?>
<Mediainfo
version="0.1"
ref="sources/234p_0.ts">
<File>
<track type="General">
<Count>324</Count>
<Count_of_stream_of_this_kind>1</Count_of_stream_of_this_kind>
<Kind_of_stream>General</Kind_of_stream>
<Kind_of_stream>General</Kind_of_stream>
@edthix
edthix / video.xml
Created January 23, 2018 08:17
Some video xml
<?xml version="1.0" encoding="UTF-8"?>
<Mediainfo
version="0.1"
ref="../Videos/WCKKDEMO.mp4">
<File>
<track type="General">
<Count>325</Count>
<Count_of_stream_of_this_kind>1</Count_of_stream_of_this_kind>
<Kind_of_stream>General</Kind_of_stream>
<Kind_of_stream>General</Kind_of_stream>
@edthix
edthix / arduino_robot_sr04_3_sensors.ino
Created November 18, 2015 14:14
Arduino Robot + SR04 x 3 example
#include <ArduinoRobot.h>
#include <SPI.h>
#include "Wire.h"
/*
* Arduino Robot + SR04 example
*/
// sensor1
#define echoPin1 TKD1
@edthix
edthix / arduino_robot_sr04.ino
Created November 16, 2015 13:56
Arduino Robot + SR04 example
#include <ArduinoRobot.h>
#include <SPI.h>
#include "Wire.h"
/*
* Arduino Robot + SR04 example
*/
#define echoPin TKD3
#define trigPin TKD4

New Ruby software project procedure

First, ensure the following tools are available on the local system and reasonably up to date:

  • Git
  • Git-flow
  • RVM
  • Bash
  • SSH
# Run in idle (Windows 7, python 2.7) everything ok until table definition
>>> from sqlalchemy import create_engine, MetaData
>>> from sqlalchemy.orm import scoped_session, sessionmaker
# user/password/database I put it wrongly since this is public
>>> engine = create_engine('mssql+pyodbc://plast@user:password@database', convert_unicode=True, implicit_returning=False)
>>> metadata = MetaData(bind=engine)