Skip to content

Instantly share code, notes, and snippets.

View kpx-dev's full-sized avatar
🔥
FIRE!

Kien Pham kpx-dev

🔥
FIRE!
View GitHub Profile
<script>
// Include the UserVoice JavaScript SDK (only needed once on a page)
UserVoice=window.UserVoice||[];(function(){var uv=document.createElement('script');uv.type='text/javascript';uv.async=true;uv.src='//widget.uservoice.com/T1twXffk8kRFxQHuFsXBqA.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(uv,s)})();
//
// UserVoice Javascript SDK developer documentation:
// https://www.uservoice.com/o/javascript-sdk
//
// Set colors
@kpx-dev
kpx-dev / multiple_credentials.py
Created November 21, 2014 06:05
SendGrid Multiple Credentials
"""
This Python code snippet will show you how to work with SendGrid Multiple
Credentials
install the amazing requests library
$ pip install requests==2.4.3
export your SendGrid credential from command line
$ export SG_USERNAME=your_sg_username
$ export SG_PASSWORD=your_sg_password
"""
This Python code snippet will show you how to get all SendGrid invalid
emails records.
install the amazing requests library
$ pip install requests==2.4.3
export your SendGrid credential from command line
$ export SG_USERNAME=your_sg_username
$ export SG_PASSWORD=your_sg_password
"""
This Python code snippet will show you how to get work with SendGrid filter
settings
install the amazing requests library
$ pip install requests==2.4.3
export your SendGrid credential from command line
$ export SG_USERNAME=your_sg_username
$ export SG_PASSWORD=your_sg_password
@kpx-dev
kpx-dev / filter_commands.py
Created November 21, 2014 04:10
SendGrid filters commands
"""
This Python code snippet will show you how to get work with SendGrid filter
commands
install the amazing requests library
$ pip install requests==2.4.3
export your SendGrid credential from command line
$ export SG_USERNAME=your_sg_username
$ export SG_PASSWORD=your_sg_password
@kpx-dev
kpx-dev / bounces.py
Created November 20, 2014 20:11
SendGrid bounces example
"""
This Python code snippet will show you how to get all SendGrid bounces
records.
install the amazing requests library
$ pip install requests==2.4.3
export your SendGrid credential from command line
$ export SG_USERNAME=your_sg_username
$ export SG_PASSWORD=your_sg_password
@kpx-dev
kpx-dev / sendgrid_block.py
Created November 20, 2014 19:55
SendGrid block example with requests library
"""
This Python code snippet will show you how to get all SendGrid block records
Please change SG_USERNAME and SG_PASSWORD to match your credentials
install the amazing requests library
$ pip install requests==2.4.3
save this file as python block.py and run it
$ python block.py
"""
import base64
import hashlib
import random
# generate random string length of 43
base64.b64encode(hashlib.sha256( str(random.getrandbits(256)) ).digest(), random.choice(['rA','aZ','gQ','hH','hG','aR','DD'])).rstrip('==')
@kpx-dev
kpx-dev / gunicorn
Created October 15, 2013 06:08 — forked from xspager/gunicorn
#!/bin/sh
### BEGIN INIT INFO
# Provides: gunicorn
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the gunicorn server
# Description: starts gunicorn using start-stop-daemon
@kpx-dev
kpx-dev / configure.sh
Created August 9, 2012 20:19
Configure parameters for PHP 5.4 on Lion mac os x
./configure \
--prefix=/usr \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--sysconfdir=/private/etc \
--with-apxs2=/usr/sbin/apxs \
--enable-cli \
--with-config-file-path=/etc \
--with-libxml-dir=/usr \
--with-openssl=/usr \