Skip to content

Instantly share code, notes, and snippets.

View lewis-carson's full-sized avatar

Lewis Carson lewis-carson

View GitHub Profile
@lewis-carson
lewis-carson / split.css
Created October 19, 2018 20:13
an extremely simple css boilerplate for dividing pages
.col1{
width: 8.333%;
float: left;
}
.col2{
width: 16.666%;
float: left;
}
@lewis-carson
lewis-carson / aek.otf
Last active September 1, 2018 11:44
fonts
import os
import csv
import re
tot = ''
for i in os.listdir('csv'):
with open('csv/' + i) as f:
tot += f.read().replace(',\n', '\n')
print(f.read())
util = require('util');
require('util.promisify').shim();
exec = util.promisify(require('child_process').exec);
atom.commands.add 'atom-text-editor', 'blog:publish', ->
editor = atom.workspace.getActivePaneItem()
file = editor?.buffer.file.path.split('\\')
file.splice(-1,1)
{ stdout, stderr } = exec("cd #{file.join('\\')} && git add * && git commit * -m \"Updated blog\" && git push");
with open('out.py', 'w') as f:
f.write('')
def write(text, indent):
with open('out.py', 'a') as f:
f.write((indent * ' ') + text + '\n')
return
with open('in.txt') as f:
lines = f.readlines()
class world:
def turn(self):
print('this is the world\'s turn')
class prompt:
def handle(self, command):
w.turn() #Calls worlds turn
def turn(self):
command = input('# ') #This is where the users command is prompted
p.handle(command) #calling this as a seperate function to process the input from the prompt
@lewis-carson
lewis-carson / r0b0t.ahk
Last active January 18, 2018 21:05
My custom AHK script. remember to change the paths at the end if you want the shortcuts for sublime, hyper, and chrome. To use install autohotkey and place this script in your startup folder. **disclaimer: i didnt make most of this script. It is just hacked togetehr from throughout the web**
#Persistent
#SingleInstance force
;; tiling window manager for windows 7-10 designed for 1 or 2 monitors arranging
;; windows in the following pattern with configurable window sizes and borders:
;; _________ _________
;; | | | | |___| <- primary monitor
;; | | | | | |
;; '---i-----' '-----i---'
$(document).delegate('#textbox', 'keydown', function(e) {
var keyCode = e.keyCode || e.which;
if (keyCode == 9) {
e.preventDefault();
var start = this.selectionStart;
var end = this.selectionEnd;
// set textarea value to: text before caret + tab + text after caret
$(this).val($(this).val().substring(0, start) +