Skip to content

Instantly share code, notes, and snippets.

View skrolikowski's full-sized avatar
Coffee, Code & Cats

Shane Krolikowski skrolikowski

Coffee, Code & Cats
View GitHub Profile
@skrolikowski
skrolikowski / sublime-build
Created May 17, 2018 21:14
Python v3 - Sublime Text 3 Build (Mac OS)
{
"cmd": ["python3", "-u", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python, source.py"
}
@skrolikowski
skrolikowski / sublime-build
Created May 17, 2018 21:16
Love2D - Sublime Text 3 Build
{
"selector": "source.lua",
"file_regex": "^Error: (?:[^:]+: )?([^: ]+?):(\\d+):() ([^:]*)$",
"windows": {
"cmd": ["C:/Program Files/LOVE/love.exe", "${folder:${file_path}}"],
"shell": true
},
"osx": {
"cmd": ["/Applications/love.app/Contents/MacOS/love", "${file_path}"]
},
@skrolikowski
skrolikowski / markdown
Created May 30, 2018 21:52
MinGW + SublimeText 3 + Google Test (Windows 10 x86)
### Download Cmake
Download the CMake `Windows win32-x86 Installer`:
https://cmake.org/download/
### Download latest Google Test release
Download latest release of Google Test:
https://github.com/google/googletest/releases
### Build for MinGW
After downloading Google Test navigate to the `src/` folder and use CMake to build the library files (I'm using [Git Bash](https://git-scm.com/downloads)):
@skrolikowski
skrolikowski / divisorFunction.py
Last active January 21, 2019 05:05
Divisor Function
def divisors(num):
return [x in range(1, num // 2) if num % x == 0];
@skrolikowski
skrolikowski / linkedList.py
Last active January 21, 2019 05:05
Linked List
# Simple Node definition with value and next pointer.
class Node:
def __init__(self, value = 0):
self.value = value
self.next = None
for v in values:
self.add(v)
def __iter__(self):
@skrolikowski
skrolikowski / reverseInteger.py
Last active January 21, 2019 05:05
Reverse integer (Python)
def reverseInteger(val):
sign = -1 if val < 0 else 1
val = abs(val)
rev = 0
while val > 0:
num = val % 10
val = val // 10
rev = rev * 10 + num
@skrolikowski
skrolikowski / App.config
Last active January 24, 2019 07:27
[log4net] TraceAppender
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
</configSections>
<log4net>
<appender name="TraceAppender" type="log4net.Appender.TraceAppender">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date] %level (%logger:%line) - %message%newline" />
</layout>
@skrolikowski
skrolikowski / Grid.cs
Last active February 5, 2019 06:59
GameExample.Map.Grid
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using MonoGame.Extended;
using MonoGame.Extended.Shapes;
namespace EGen.Map
{
public class Grid
{
@skrolikowski
skrolikowski / IsoGrid.cs
Last active February 5, 2019 07:01
GameExample.Map.IsoGrid
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using MonoGame.Extended;
using MonoGame.Extended.Shapes;
namespace EGen.Map
{
public class Grid
{
@skrolikowski
skrolikowski / mergeSort.py
Created February 11, 2019 00:55
MergeSort - Linked List
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class MergeSort:
def __init__(self, head: ListNode):
self.head = None
def sortList(self, head: ListNode):