Skip to content

Instantly share code, notes, and snippets.

View sparkingdark's full-sized avatar
🏠
Working from home

Debojyoti Chakraborty sparkingdark

🏠
Working from home
View GitHub Profile
@sparkingdark
sparkingdark / activation_functions.ipynb
Created January 15, 2020 11:24
activation_functions.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sberryman
sberryman / Dockerfile.yml
Last active January 31, 2024 13:20
AlphaPose Dockerfile
FROM nvidia/cuda:8.0-cudnn5-devel
# Supress warnings about missing front-end. As recommended at:
# http://stackoverflow.com/questions/22466255/is-it-possibe-to-answer-dialog-questions-when-installing-under-docker
ARG DEBIAN_FRONTEND=noninteractive
# Install some dependencies
RUN apt-get update && \
apt-get install -y \
apt-utils \
@linwoodc3
linwoodc3 / utilities.py
Last active April 2, 2024 15:35
A python script to scrape text from websites. This works surprisingly well on most news websites when you have the URL to the story. Use GDELT urls for the best results.
# Author: Linwood Creekmore
# Email: valinvescap@gmail.com
# Description: Python script to pull content from a website (works on news stories).
#Licensed under GNU GPLv3; see https://choosealicense.com/licenses/lgpl-3.0/ for details
# Notes
"""
23 Oct 2017: updated to include readability based on PyCon talk: https://github.com/DistrictDataLabs/PyCon2016/blob/master/notebooks/tutorial/Working%20with%20Text%20Corpora.ipynb
18 Jul 2018: added keywords and summary
@saucecode
saucecode / my_flask_program.py
Created December 31, 2016 06:50
how to correctly use a letsencrypt cert with flask
...
from OpenSSL import SSL
...
context = SSL.Context(SSL.TLSv1_2_METHOD)
context.use_privatekey_file('/etc/letsencrypt/live/DOMAIN.COM/privkey.pem')
context.use_certificate_chain_file('/etc/letsencrypt/live/DOMAIN.COM/fullchain.pem')
context.use_certificate_file('/etc/letsencrypt/live/DOMAIN.COM/cert.pem')
@mmccaff
mmccaff / json-split.py
Created September 30, 2015 20:05 — forked from 97-109-107/json-split.py
A tiny python thing to split big json files into smaller junks.
#!/usr/bin/env python
# based on http://stackoverflow.com/questions/7052947/split-95mb-json-array-into-smaller-chunks
# usage: python json-split filename.json
# produces multiple filename_0.json of 1.49 MB size
import json
import sys
with open(sys.argv[1],'r') as infile:
o = json.load(infile)
@abonhomme
abonhomme / test_apns.py
Created January 7, 2014 22:07
Manual sending of a push notification to APNS via python
import socket, ssl, json, struct, sys
#originally from: http://stackoverflow.com/questions/1052645/apple-pns-push-notification-services-sample-code
# device token returned when the iPhone application
# registers to receive alerts
deviceToken = 'XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX'
thePayLoad = {
@netoxico
netoxico / Apple push notification
Created December 16, 2013 23:48
Apple push notification with python
#!/usr/bin/env python
import ssl
import json
import socket
import struct
import binascii
def send_push_message(token, payload):
# the certificate file generated from Provisioning Portal
@vunb
vunb / ffmpeg-convert-mp3-to-wave
Created November 7, 2013 04:52
Convert mp3 to wave format using ffmpeg
ffmpeg -i input.mp3 -acodec pcm_s16le -ac 1 -ar 16000 output.wav
# To convert all mp3 files in a directory in Linux:
for f in *.mp3; do ffmpeg -i "$f" -acodec pcm_s16le -ac 1 -ar 16000 "${f%.mp3}.wav"; done
# Or Windows:
for /r %i in (*) do ffmpeg -i %i -acodec pcm_s16le -ac 1 -ar 16000 %i.wav