Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Joseph Cottingham JosephCottingham

🎯
Focusing
View GitHub Profile
@nikhilkumarsingh
nikhilkumarsingh / google_calendar_api_integration.ipynb
Created May 10, 2019
Integrating Google Calendar API in Python Projects
View google_calendar_api_integration.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@eLement87
eLement87 / mqtt_tls_working.ino
Created Dec 10, 2017
ESP8266 Secure MQTT Connection with Client Certificate Authentication
View mqtt_tls_working.ino
#include <FS.h>
#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
#include <PubSubClient.h>
#include <time.h>
// Insert your FQDN of your MQTT Broker
#define MQTT_SERVER "mqtt.srvx1.local"
const char* mqtt_server = MQTT_SERVER;
@jakebrinkmann
jakebrinkmann / connect_psycopg2_to_pandas.py
Created Jul 3, 2017
Read SQL query from psycopg2 into pandas dataframe
View connect_psycopg2_to_pandas.py
import pandas as pd
import pandas.io.sql as sqlio
import psycopg2
conn = psycopg2.connect("host='{}' port={} dbname='{}' user={} password={}".format(host, port, dbname, username, pwd))
sql = "select count(*) from table;"
dat = sqlio.read_sql_query(sql, conn)
conn = None
@DmitryBe
DmitryBe / app.py
Created Mar 3, 2017
SQLAlchemy quick start
View app.py
# http://bytefish.de/blog/first_steps_with_sqlalchemy/
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import create_engine
from datetime import datetime, timedelta
from sqlalchemy import Table, Column, Integer, String, DateTime, ForeignKey
from sqlalchemy.orm import relationship, backref
from sqlalchemy.orm import sessionmaker
Base = declarative_base()
@mjrulesamrat
mjrulesamrat / countryinfo.py
Created Jul 14, 2016 — forked from pamelafox/countryinfo.py
Python list of country codes, names, continents, capitals, and pytz timezones
View countryinfo.py
countries = [
{'timezones': ['Europe/Andorra'], 'code': 'AD', 'continent': 'Europe', 'name': 'Andorra', 'capital': 'Andorra la Vella'},
{'timezones': ['Asia/Kabul'], 'code': 'AF', 'continent': 'Asia', 'name': 'Afghanistan', 'capital': 'Kabul'},
{'timezones': ['America/Antigua'], 'code': 'AG', 'continent': 'North America', 'name': 'Antigua and Barbuda', 'capital': "St. John's"},
{'timezones': ['Europe/Tirane'], 'code': 'AL', 'continent': 'Europe', 'name': 'Albania', 'capital': 'Tirana'},
{'timezones': ['Asia/Yerevan'], 'code': 'AM', 'continent': 'Asia', 'name': 'Armenia', 'capital': 'Yerevan'},
{'timezones': ['Africa/Luanda'], 'code': 'AO', 'continent': 'Africa', 'name': 'Angola', 'capital': 'Luanda'},
{'timezones': ['America/Argentina/Buenos_Aires', 'America/Argentina/Cordoba', 'America/Argentina/Jujuy', 'America/Argentina/Tucuman', 'America/Argentina/Catamarca', 'America/Argentina/La_Rioja', 'America/Argentina/San_Juan', 'America/Argentina/Mendoza', 'America/Argentina/Rio_Gallegos', 'America/Argentina/Ushuai
@chenjianjx
chenjianjx / start-celery-for-dev.py
Created Mar 10, 2016
A python script which starts celery worker and auto reload it when any code change happens.
View start-celery-for-dev.py
'''
A python script which starts celery worker and auto reload it when any code change happens.
I did this because Celery worker's "--autoreload" option seems not working for a lot of people.
'''
import time
from watchdog.observers import Observer ##pip install watchdog
from watchdog.events import PatternMatchingEventHandler
import psutil ##pip install psutil
import os