Skip to content

Instantly share code, notes, and snippets.

View nathan-osman's full-sized avatar

Nathan Osman nathan-osman

View GitHub Profile
@nathan-osman
nathan-osman / build-qt5
Last active April 23, 2024 12:33
This script provides an easy way to build Qt5 for both 32 and 64-bit Windows. This script assumes that the Mingw-w64 compilers are installed on the host as well as Perl.
#!/bin/bash
#===========================================
# Download URLs for the required libraries.
#===========================================
# NOTE: if you add a URL here, you also need to add it to the
# $packages_to_build list to ensure the proper order.
declare -A urls=(
@nathan-osman
nathan-osman / CMakeLists.txt
Last active April 2, 2024 21:27
Generates a self-signed x509 certificate using OpenSSL.
# A simple CMake script for building the application.
cmake_minimum_required(VERSION 2.8)
project(create-x509)
# Our only dependency is OpenSSL
find_package(OpenSSL REQUIRED)
include_directories(${OPENSSL_INCLUDE_DIR})
add_executable(create-x509 create-x509.cpp)
@nathan-osman
nathan-osman / Makefile
Last active December 14, 2015 22:18
Updates the specified Git repository from the specified remote.
CC=gcc
git2-fetch: git2-fetch.o
$(CC) git2-fetch.o -lgit2 -o git2-fetch
git2-fetch.o: git2-fetch.c
$(CC) -c git2-fetch.c
@nathan-osman
nathan-osman / Makefile
Last active December 14, 2015 23:18
Walks through the commits in the specified Git repository.
CC=gcc
git2-walk: git2-walk.o
$(CC) git2-walk.o -lgit2 -o git2-walk
git2-walk.o: git2-walk.c
$(CC) -c git2-walk.c
@nathan-osman
nathan-osman / Makefile
Created April 22, 2013 18:28
Demonstrates the implementation of a "variant" type in C++.
CXX = g++
LD = g++
variant: main.o
$(LD) main.o -o variant
main.o: type.h variant.h main.cpp
$(CXX) -c main.cpp -o main.o
@nathan-osman
nathan-osman / Makefile
Created August 19, 2013 00:11
Represents a simple class in C++ for storing values of any type.
all: variant
variant.o: variant.cpp variant.h value.h
g++ -c variant.cpp
main.o: main.cpp variant.h value.h
g++ -c main.cpp
variant: variant.o main.o
g++ variant.o main.o -o variant
@nathan-osman
nathan-osman / ie6.sh
Created August 24, 2013 18:53
Creates a compressed tarball containing the installation files for Internet Explorer 6 with SP1.
#!/bin/bash
set -e
# These are the files to be downloaded
FILES="ACTSETUP.CAB ADVAUTH.CAB AOLSUPP.CAB AXA.CAB AXA3.CAB BRANDING.CAB CRLUPD.CAB FONTCORE.CAB FONTSUP.CAB GSETUP95.CAB GSETUPNT.CAB HELPCONT.CAB HHUPD.CAB ICW.CAB ICWCON.CAB IE4SHLNT.CAB IE6SETUP.EXE IEAK6.EXE IEAK6CD.EXE IEAK6OPT.CAB IECIF.CAB IEDATA.CAB IEDOM.CAB IELPKAD.CAB IELPKAR.CAB IELPKIW.CAB IELPKJA.CAB IELPKKO.CAB IELPKPE.CAB IELPKTH.CAB IELPKVI.CAB IELPKZHC.CAB IELPKZHT.CAB IEMIL_1.CAB IEMIL_2.CAB IEMIL_3.CAB IEMIL_4.CAB IENT_S1.CAB IENT_S2.CAB IENT_S3.CAB IENT_S4.CAB IENT_S5.CAB IENT_S6.CAB IEW2K_1.CAB IEW2K_2.CAB IEW2K_3.CAB IEW2K_4.CAB IE_EXTRA.CAB IE_S1.CAB IE_S2.CAB IE_S3.CAB IE_S4.CAB IE_S5.CAB IE_S6.CAB JAAIME.CAB KOAIME.CAB MAILNEWS.CAB MOBILE95.CAB MOBILENT.CAB MPCDCS.CAB MPLAY2A.CAB MPLAY2U.CAB MPLAYER2.CAB OAINST.CAB OEEXCEP.CAB README.CAB SCAIME.CAB SCR56EN.CAB SCRIPTEN.CAB SETUPNT.CAB SETUPW95.CAB SWFLASH.CAB TCAIME.CAB TS95.CAB TSNT.CAB USP10.CAB VGX.CAB WAB.CAB"
# Create a directory for the downloaded files
mkdir -p ie6
@nathan-osman
nathan-osman / github-commit-diff-link.user.js
Last active December 21, 2015 18:19 — forked from SignpostMarv/github-commit-diff-link.user.js
Adds a "View Diff" button to commit pages.
@nathan-osman
nathan-osman / 15511_and_17051.diff
Last active December 21, 2015 18:28
Bug #15511 and #17051 Patch for Django 1.5.2
=== modified file 'django/contrib/auth/tests/forms.py'
--- django/contrib/auth/tests/forms.py 2013-08-26 21:11:16 +0000
+++ django/contrib/auth/tests/forms.py 2013-08-27 00:25:07 +0000
@@ -7,7 +7,7 @@
ReadOnlyPasswordHashWidget)
from django.contrib.auth.tests.utils import skipIfCustomUser
from django.core import mail
-from django.forms.fields import Field, EmailField, CharField
+from django.forms.fields import Field, CharField
from django.test import TestCase
@nathan-osman
nathan-osman / requirements.txt
Last active December 26, 2015 17:59
Monitors a list of websites, providing notifications when something goes wrong.
ledcontrol>=0.2
twitter