Skip to content

Instantly share code, notes, and snippets.

View kevincox's full-sized avatar
🐈

Kevin Cox kevincox

🐈
View GitHub Profile
@kevincox
kevincox / facebook-messenger-media-timestamps.py
Last active August 14, 2023 20:14
Update media timestamps in Facebook Messenger Download
#!/usr/bin/env python3
import datetime
import glob
import json
import subprocess
for f in glob.glob("messages/*/*/message_*.json"):
print(f)
d = json.load(open(f))
Developer Certificate of Origin
Version 1.1
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
@kevincox
kevincox / bufferediterator.rs
Created July 16, 2017 14:23
Rust Buffered Iterator
extern crate std;
pub struct BufferedIterator<Iter: Iterator> {
iter: Iter,
buffer: Vec<Iter::Item>,
}
impl<Iter: Iterator> BufferedIterator<Iter> {
pub fn new(iter: Iter) -> Self {
BufferedIterator{
@kevincox
kevincox / gist:57bc8bd53ea76cfc9969a62b8770e4ce
Created September 3, 2016 10:25
Blockstack verification
Verifying that "kevincox.id" is my Blockstack ID. https://onename.com/kevincox
@kevincox
kevincox / keybase.md
Last active September 26, 2021 13:13

Keybase proof

I hereby claim:

  • I am kevincox on github.
  • I am kevincox (https://keybase.io/kevincox) on keybase.
  • I have a public key whose fingerprint is B66B 891D D83B 0E67 7D84 FC30 9BB9 2CC1 552E 99AA

To claim this, I am signing this object:

#include <stdio.h>
#define def int
#define beer main(int i){char b[1024];
#define print(v) print(int v){
#define end ;}
#define if(x) fputs(b,stdout); fgets(b,1024,f); if(x){
#define else ;} else{
#define puts
#define print
#define open(fn) FILE *f = fopen(fn,"r");
@kevincox
kevincox / compatibe.c
Last active December 25, 2015 22:18
Checking for compatible version.
#include <assert.h>
/// Check if versions are compatible.
/**
* Compares the required and available versions and returns true iff the
* requirement is satisfied.
*/
int compatible(unsigned r_major, unsigned r_minor, unsigned r_patch,
unsigned a_major, unsigned a_minor, unsigned a_patch)
{
@kevincox
kevincox / gist:5499318
Created May 2, 2013 00:08
Bash status message function.
#! /bin/bash
# Copyright 2009-2013 Kevin Cox
################################################################################
# #
# This software is provided 'as-is', without any express or implied #
# warranty. In no event will the authors be held liable for any damages #
# arising from the use of this software. #
# #
@kevincox
kevincox / l10gen.py
Created September 12, 2012 12:43
Firefox Addon Locale Manager
#! /usr/bin/env python
### SETTINGS ###
locales = "chrome/locale/" # The location of the locales.
baseLocale = "en-US" # The locale to match other locales to.
addFiles = True # Wether to add new files.
addKeys = True # Wether to add new keys or not.
@kevincox
kevincox / package.py
Created October 11, 2011 21:55
A Firefox Add-on Packager Script
#! /usr/bin/env python
### Settings ###
# Files to include in the archive are selected by using include and ignore.
# include and ignore are a list of regular expressions. Files will be packed
# if they match any regular expression in include and do not match any
# expression in ignore. All matching is done using Python re
# (http://docs.python.org/py3k/library/re.html) using the search method so you
# must explicitly write ^ if beginning of line matching is desired. The full