Skip to content

Instantly share code, notes, and snippets.

Dylan McKay dylanmckay

View GitHub Profile
View Dockerfile
# Taken from
# http://www-lipn.univ-paris13.fr/~loddo/files/PROJETS-TUTORES_2016-17/RAPPORTS_2017/g09_LODDO_docker_BERNARD_SAKPONOU_JAYARAJAH_VARELA-TAVARES.pdf
FROM ubuntu:16.04
MAINTAINER David, Jérémy, Jonathan, Thanushan
# Installation des applications qu'utilise Marionnet
RUN apt-get update && apt-get install -y \
gcc \
g++ \
make \
@dylanmckay
dylanmckay / facebook-contact-info-summary.rb
Last active Apr 25, 2019
A Ruby script for collecting phone record statistics from a Facebook user data dump
View facebook-contact-info-summary.rb
#! /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
@dylanmckay
dylanmckay / update-rust-github-email.rb
Created Oct 20, 2017
Script to update email address in GitHub Rust repositories containing Cargo.toml
View update-rust-github-email.rb
#! /usr/bin/env ruby
require 'json'
require "net/http"
require "uri"
require 'fileutils'
USERNAME = "dylanmckay"
OLD_EMAIL = "dylanmckay34@gmail.com"
NEW_EMAIL = "me@dylanmckay.io"
@dylanmckay
dylanmckay / pom.xml
Last active Oct 1, 2017
Example pom.xml file for the Maven Java tool
View pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.swen</groupId>
<artifactId>herebethetitle</artifactId>
<version>0.0.1</version>
<name>Here Be The Title</name>
<description>Complete quests and be awarded the title of Knight</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
View check-everything-upstreamed.rb
#! /usr/bin/env ruby
# Verifies that every AVR-specific commit in Github:avr-rust/llvm has been
# upstreamed to LLVM trunk.
Commit = Struct.new(:oid, :message)
def log(arguments = [])
raw_output = `git log --oneline --no-decorate #{arguments}`
@dylanmckay
dylanmckay / Arduino code in LLVM IR form.md
Last active Aug 29, 2015
Arduino core in LLVM IR form
View Arduino code in LLVM IR form.md

Here is the Arduino core compiled into LLVM IR files

They were generated using:

for file in $(find -name "*.cpp"); do                                                                                                                                        
    clang++ $file -I ./ -I ../../variants/standard/ -o ~/Ard/$(basename $file .cpp).ll \
            -c --target=avr -I /usr/avr/include -S -emit-llvm -mcpu=atmega328p -DF_CPU=16000000 -O
done

for file in $(find -name "*.c"); do                                                                                                                                        
@dylanmckay
dylanmckay / dumped machine code
Created Jul 6, 2015
Compiled to machine code vs compiled to assembly
View dumped machine code
exl.o: file format elf32-avr
Disassembly of section .text:
00000000 <main>:
0: 0f 93 push r16
2: 1f 93 push r17
4: cf 93 push r28
You can’t perform that action at this time.