Skip to content

Instantly share code, notes, and snippets.

View shkbahmad's full-sized avatar
🤘

Shakeeb Ahmad shkbahmad

🤘
View GitHub Profile
{
"accounts": [
{
"account_id": "BxBXxLj1m4HMXBm9WZZmCWVbPjX16EHwv99vp",
"balances": {
"available": 100,
"current": 110,
"iso_currency_code": "USD",
"limit": null,
"unofficial_currency_code": null
@shkbahmad
shkbahmad / xpt2046_ads7846_3-5_GPIO_setup.md
Last active October 29, 2020 17:26
xpt2046 ads7846 3.5" GPIO Touchscreen Config For Raspbian Buster

sudo apt-get update

sudo apt-get upgrade

sudo reboot

sudo raspi-config

Go to Interface Options and Enable SPI

@shkbahmad
shkbahmad / theta_absolutes.js
Last active August 7, 2020 01:25
theta absolutes
[
[-0.01666159, 0.0, 0.0, 0.0],
[0.445448, 0.0, 0.0, 0.0],
[0.480111, 0.0, 0.0, 0.0],
[0.5761033, 0.0, 0.0, 0.0],
[0.5563617, 0.0, 0.0, 0.0],
[0.4982619, 0.0, 0.0, 0.0],
[-0.2937724, 0.0, 0.0, 0.0],
[-0.2649893, 0.0, 0.0, 0.0],
[-0.1881449, 0.0, 0.0, 0.0],

update & install

brew update brew install postgres

create postgres db

postgres -D /usr/local/var/postgres brew services start postgres

create your username db createdb whoami

Error

FATAL: data directory "/usr/local/var/postgres" has group or world access

DETAIL: Permissions should be u=rwx (0700).

Solution

sudo chown -R <USERNAME> /usr/local/var/postgres

sudo chmod -R 700 /usr/local/var/postgres

@shkbahmad
shkbahmad / calendar.css
Created May 13, 2015 07:18
Rails Calendar
#activities-calendar .calendar {
border-collapse: collapse;
width: 100%;
}
#activities-calendar .calendar td, th {
font-size: 10px;
padding: 6px;
border: 1px solid #999;
}
import librets
mongo = None
db = None
rdb = None
mls = None
try:
mongo = pymongo.Connection()
assert isinstance(mongo, pymongo.Connection)