Skip to content

Instantly share code, notes, and snippets.

View tomdaley92's full-sized avatar
💾
Loading...

Tom Daley tomdaley92

💾
Loading...
View GitHub Profile
@tomdaley92
tomdaley92 / ethos.py
Last active December 31, 2017 07:23
Ethos programming challenge <http://dev.getethos.com>
#!/usr/bin/env python3
'''
Thomas Daley
October 16, 2017
This code contains the solution for the programming
challenge hosted at dev.getethos.com
The first step is to find the instructions which can be
@tomdaley92
tomdaley92 / update_requirements.sh
Last active February 8, 2018 18:55
Update all pip packages within a virtualenv
# Check and update all local packages
pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U
# Write the new requirements to a file
pip freeze > requirements.txt
#!/usr/bin/env python
import os
from sys import argv
from subprocess import Popen
def create_file(hidden, n):
with open(hidden, 'wb') as f:
f.seek(n-1)
f.write(b'\x00')
@tomdaley92
tomdaley92 / makefile
Last active December 5, 2018 09:38
Build template for Windows C/C++ programs
# Author: Thomas Daley
# Date: September 16, 2016
# Purpose: Build template for Windows C/C++ Programs.
#
# Note: Microsoft Visual C/C++ Build Tools are assumed to be installed and
# added to PATH. The folders "src" and "bin" are expected.
#
# 1) vcvarsall
# 2) nmake
@tomdaley92
tomdaley92 / example.h
Created December 19, 2018 00:25
Prevent name mangling of C code with C++ compiler
#ifdef __cplusplus
extern "C" {
#endif
/* Declarations of this file */
#ifdef __cplusplus
}
#endif
@tomdaley92
tomdaley92 / filename.h
Last active January 29, 2019 23:00
C/C++ Header guards
#ifndef FILENAME_H
#define FILENAME_H
/* Declarations of this file */
#endif /* FILENAME_H */
@tomdaley92
tomdaley92 / Preferences.sublime-settings
Last active July 3, 2021 20:57
Sublime Text 4 Settings
{
"close_windows_when_empty": false,
"color_scheme": "Packages/Color Scheme - Default/Monokai.sublime-color-scheme",
"default_line_ending": "unix",
"drag_text": false,
"ensure_newline_at_eof_on_save": true,
"font_face": "Consolas",
"font_options":
[
"subpixel_antialias"
@tomdaley92
tomdaley92 / Preferences.sublime-settings
Last active July 3, 2021 21:00
Sublime Merge 2 Settings
{
"always_show_command_status": true,
"expand_merge_commits_by_default": true,
"theme": "Merge Dark.sublime-theme",
"translate_tabs_to_spaces": true,
"git_binary": "system",
"ui_scale": 1.15,
"hardware_acceleration": "opengl",
"font_size": 10,
}
@tomdaley92
tomdaley92 / rsub_setup.md
Last active July 19, 2021 11:16
Installing and configuring rsub for editing files with sublime through ssh
  1. Install rmate on the remote server
sudo wget -O /usr/local/bin/rsub https://raw.github.com/aurora/rmate/master/rmate && sudo chmod a+rx /usr/local/bin/rsub
  1. Modify your ~/.ssh/config file on your local machine
Host *
@tomdaley92
tomdaley92 / .Xmodmap
Last active September 5, 2021 01:59
Debian Caps-lock Re-purposing
keycode 66 = Mode_switch
keysym j = j J Left
keysym l = l L Right
keysym i = i I Up
keysym k = k K Down
keysym u = u U Home
keysym o = o O End