Skip to content

Instantly share code, notes, and snippets.

@dylanmckay
dylanmckay / facebook-contact-info-summary.rb
Last active March 12, 2024 22:46
A Ruby script for collecting phone record statistics from a Facebook user data dump
#! /usr/bin/env ruby
# NOTE: Requires Ruby 2.1 or greater.
# This script can be used to parse and dump the information from
# the 'html/contact_info.htm' file in a Facebook user data ZIP download.
#
# It prints all cell phone call + SMS message + MMS records, plus a summary of each.
#
# It also dumps all of the records into CSV files inside a 'CSV' folder, that is created
@tjoen
tjoen / stt_tts_nl.py
Created March 6, 2018 17:11
Dutch Google stt and tts in python
#!/usr/bin/env python
#-*- coding: utf-8 -*-
from gtts import gTTS
import os
import speech_recognition as sr
import tempfile
import time
import pyaudio
import wave
@algal
algal / nginx-cors.conf
Created April 29, 2013 10:52
nginx configuration for CORS (Cross-Origin Resource Sharing), with an origin whitelist, and HTTP Basic Access authentication allowed
#
# A CORS (Cross-Origin Resouce Sharing) config for nginx
#
# == Purpose
#
# This nginx configuration enables CORS requests in the following way:
# - enables CORS just for origins on a whitelist specified by a regular expression
# - CORS preflight request (OPTIONS) are responded immediately
# - Access-Control-Allow-Credentials=true for GET and POST requests
@sra448
sra448 / tail.py
Created November 9, 2011 16:44
sublime text 2 command for tailing and greping the rails logfile
import sublime, sublime_plugin, os
class TailCommand(sublime_plugin.TextCommand):
def run(self, edit):
from datetime import datetime
filtertext = "FLO"
# open sublime console
self.view.window().run_command("show_panel", { "panel": "console", "toggle": "true" })
@michiel
michiel / cors-nginx.conf
Created July 5, 2011 10:41
Wide-open CORS config for nginx
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#