Skip to content

Instantly share code, notes, and snippets.

View tantita's full-sized avatar

Abdullahi Ajibola tantita

View GitHub Profile
@tantita
tantita / a2dp.py
Created July 7, 2017 08:25 — forked from pylover/a2dp.py
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04, 16.10 and also debian jessie, with bluez5.
#! /usr/bin/env python3.5
"""
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04 and also debian jessie, with bluez5.
Workaround for bug: https://bugs.launchpad.net/ubuntu/+source/indicator-sound/+bug/1577197
Run it with python3.5 or higher after pairing/connecting the bluetooth stereo headphone.
This will be only fixes the bluez5 problem mentioned above .
@tantita
tantita / install-comodo-ssl-cert-for-nginx.rst
Created February 28, 2016 23:58 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@tantita
tantita / charge.test.html
Created February 21, 2016 14:58 — forked from kaiserama/charge.test.html
Flask + Stripe Connect
<h1>
Test Charges
</h1>
<p>Your credit card will charged later.</p>
<form action="{{ url_for('charge_test') }}" id="pay_form" class="pull-right" method="post">
<script src="https://checkout.stripe.com/v2/checkout.js" class="stripe-button" data-key="{{ key }}" data-name="Application Name Here" data-description="Test Reservation" data-amount="5000"></script>
</form>
@tantita
tantita / python-log.py
Last active June 19, 2017 15:01
python log
# loggex.py
# ref: https://impythonist.wordpress.com/2015/10/11/five-trivial-things-every-python-programmer-should-work-with/
import logging
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
fh = logging.FileHandler('add.log')
@tantita
tantita / bash
Last active February 14, 2016 13:12
bash scripts
for file in /etc/ssh/*_key.pub; do ssh-keygen -lf $file; done
# or
for file in /etc/ssh/*_key.pub
do ssh-keygen -lf $file
done
#######################################
seq 1 10 will generate 1 to 10
for i in `seq 1 10`
@tantita
tantita / app.js
Created February 4, 2016 14:27 — forked from weikinhuang/app.js
Express 4 and socket.io share sessions
var express = require("express");
var path = require("path");
var favicon = require("serve-favicon");
var logger = require("morgan");
var cookieParser = require("cookie-parser");
var bodyParser = require("body-parser");
var session = require("express-session");
var cookie = require("cookie");
var q = require("q");
@tantita
tantita / thanks.py
Created January 12, 2016 18:34
Thanks to facebook birthday wishes
import sys
from urllib import urlencode
import requests
from urlparse import urlparse, parse_qs
from random import choice
import re
self_id = '10204360172032372' # your facebook id here
utc_bday = '2014-07-27 18:30:00' # utc timestamp of your birthday
@tantita
tantita / .gitconfig
Created January 12, 2016 18:33 — forked from pksunkara/config
Sample of git config file (Example .gitconfig)
[user]
name = Pavan Kumar Sunkara
email = pavan.sss1991@gmail.com
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[sendemail]
smtpencryption = tls
smtpserver = smtp.gmail.com
@tantita
tantita / attach.js
Created January 7, 2016 08:09
attach event to multiple elements
$(a & b).click(function () { /* */ }); // <= works (event is attached to both)
var a = $("#a");
var b = $("#b");
var combined = a.add(b)
@tantita
tantita / OO.js
Created November 23, 2015 18:13
Object oriented JS
var Cookies = {
init: function () {
var allCookies = document.cookie.split('; ');
for (var i=0;i<allCookies.length;i++) {
var cookiePair = allCookies[i].split('=');
this[cookiePair[0]] = cookiePair[1];
}
},
create: function (name,value,days) {
if (days) {