Skip to content

Instantly share code, notes, and snippets.

@dylanmckay
dylanmckay / dumped machine code
Created July 6, 2015 00:46
Compiled to machine code vs compiled to assembly
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
@dylanmckay
dylanmckay / Arduino code in LLVM IR form.md
Last active August 29, 2015 14:24
Arduino core in LLVM IR form

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 
#! /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 / pom.xml
Last active October 1, 2017 00:23
Example pom.xml file for the Maven Java tool
<?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>
@dylanmckay
dylanmckay / update-rust-github-email.rb
Created October 20, 2017 07:04
Script to update email address in GitHub Rust repositories containing Cargo.toml
#! /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"
# 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 \
This file has been truncated, but you can view the full file.
; ModuleID = 'core.3a1fbbbh-cgu.0'
source_filename = "core.3a1fbbbh-cgu.0"
target datalayout = "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8"
target triple = "avr-unknown-unknown"
%"iter::adapters::flatten::FlattenCompat<iter::adapters::Map<str::Chars, str::CharEscapeDebugContinue>, char::EscapeDebug>" = type { [0 x i8], { i8*, i8* }, [0 x i8], %"option::Option<char::EscapeDebug>", [0 x i8], %"option::Option<char::EscapeDebug>", [0 x i8] }
%"option::Option<char::EscapeDebug>" = type { [0 x i8], i8, [7 x i8] }
%"fmt::Formatter" = type { [0 x i8], i32, [0 x i8], i32, [0 x i8], i8, [0 x i8], { i8, i16 }, [0 x i8], { i8, i16 }, [0 x i8], { {}*, [3 x i16]* }, [0 x i8] }
%"iter::adapters::flatten::FlattenCompat<iter::adapters::Map<str::Chars, str::CharEscapeDefault>, char::EscapeDefault>" = type { [0 x i8], { i8*, i8* }, [0 x i8], %"option::Option<char::EscapeDefault>", [0 x i8], %"option::Option<char::EscapeDefault>", [0 x i8] }
%"option::Option<char::EscapeDefault>" = type { [0 x i8], i8, [7 x i8] }
@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