Skip to content

Instantly share code, notes, and snippets.

View CallumCarmicheal's full-sized avatar

Callum Carmicheal CallumCarmicheal

View GitHub Profile
# encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
@CallumCarmicheal
CallumCarmicheal / Simple PHP Logging to Files
Created July 29, 2016 20:12
This is a simple script to log everything requested to a page, quite useful in cases where you need to debug a external calling api but can't see the log. For example oAuth!
class Logger {
function LogCalls($filePrepend = "", $folderLocation = "GETME") {
// Get current working directory
if(\strcmp($folderLocation, "GETME") == 0)
$folderLocation = getcwd(). "/debug.output/";
$fileName = "";
/* Generate File Location */ {
// Check if directory exists
if(!\file_exists($folderLocation)) {
@CallumCarmicheal
CallumCarmicheal / Unity3d: Stop useless rendering calls
Created August 10, 2016 19:45
This will disable Meshes that cant be seen by the camera to free up some rendering calls (does not disable the object so scripts will still work!)
/// NAME Unity3d: Stop useless rendering calls
/// PROJ Tested on the Standard Assets demo
/// AUTH Callum Carmicheal
/// DESC This will disable Meshes that cant be seen by the
/// camera to free up some rendering calls (does not disable
/// the object so scripts will still work!)
/// NOTE This does not disable meshes that are behind something yet!
using UnityEngine;
using System.Collections;
@CallumCarmicheal
CallumCarmicheal / Super Secret C# CheatSheet.md
Last active August 12, 2016 20:49
A rundown of C#'s Syntax

PLEASE NOTE THIS MAY NOT BE 100% ACCURATE BUT IM SURE YOU WILL GET THE IDEA!

Note 1: When creating a property, class etc... You are not required to use the private modifier because the compiler will assume its private - it can be seen as bad pratice by few or not... its usually a personal preference!

Note 2: VARIABLES CREATED FROM WITHIN A METHOD OR FUNCTION (VOID ETC) CAN ONLY

@CallumCarmicheal
CallumCarmicheal / NotificationSkeleton.html
Created August 28, 2016 17:01
Just a skeleton for a simple jquery notification system i am doing for the LCTV Overlay
<!DOCTYPE html>
<html>
<head>
<title>Playground</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="font-awesome/css/font-awesome.min.css"/>
<link rel="stylesheet" href="css/Lobibox.min.css"/>
<link rel="stylesheet" href="css/notificationCust.css"/>
@CallumCarmicheal
CallumCarmicheal / SyntaxSchema.cs
Last active September 1, 2016 23:33
C# Python like syntax: A new syntax for C#, maybe a interesting project what's your thoughts?
/*
THIS IS THE DESIGN OF THE COMPILER, PLEASE NOTE EVERYTHING IS DUE TO CHANGE!
EVEN THE NAME IS VAILABLE FOR A CHANGE!
@author Callum Carmicheal
@date
02/09/2016 UK - 19:30->00:23 = Started the whole design of the compiler and language
@desc A simple resyntax of C#, making the code a bit more like Python's structure and syntax,
allowing code to be displayed in a cleaner and clearer way!
@CallumCarmicheal
CallumCarmicheal / CG.TheDescent.Player.cs
Created October 9, 2016 17:42
CodinGame - TheDescent
using System;
using System.Linq;
using System.IO;
using System.Text;
using System.Collections;
using System.Collections.Generic;
/**
* The while loop represents the game.
* Each iteration represents a turn of the game
@CallumCarmicheal
CallumCarmicheal / Bootstrap 3 - Dividers - Vertical and Horizontal.css
Last active October 14, 2016 21:03
Bootstrap 3 removed the dividers so i added my own ones, they automatically adjust for when the menu is swapped to portrait for navbars.
ind {
/*Indent with 4 line spacing, SUCK IT 2 LINE SPACING!*/
margin-left: 2em;
}
/* So apparently DEVIDERS in a MENU IS NOT A THING
THAT THE MASSES WANT?? MY ASS, HAVE YOU EVER SEEN
A BOOTSTRAP 2 SITE. WHAT BS */
@CallumCarmicheal
CallumCarmicheal / datatables_full_including_query_search_order.php
Created February 3, 2017 18:22
PHP DataTables: With Custom Row support
This is a quick and easy solution to DataTables server processing
Read through the documentation, this solution supports Function columns/Variable columns
in the format of {Function} where is stored in UsersTable_FilterReplace although
you can change and modify anything.
Javascript:
<script>
$(function() {
if((typeof is_function != 'function')) {
@CallumCarmicheal
CallumCarmicheal / Setting up Decaf-Emu for dummies like me!.md
Last active March 23, 2017 22:17
Setting up Decaf-Emu for dummies like me!.md

How to build on windows with Visual Studio for idiots!

Prereq: Install Windows SDK

Guide without images

To see images scroll down

  1. Clone the decaf-emu repository, git clone https://github.com/decaf-emu/decaf-emu.git
  2. Go into the downloaded repository and update the submodules git submodule update --init