Skip to content

Instantly share code, notes, and snippets.

View kalineh's full-sized avatar

kalineh

  • Funktronic Labs
  • Pasadena, CA
View GitHub Profile
@kalineh
kalineh / UnityDebugPauseEditor.cs
Last active November 20, 2015 21:18
Unity - Utility function that pauses unity editor.
using UnityEngine;
public class DebugPauseEditor
: MonoBehaviour
{
public static void Pause()
{
var target = "UnityEditor.EditorApplication";
var assemblies = System.AppDomain.CurrentDomain.GetAssemblies();
@kalineh
kalineh / QuoraHackathonArcher
Created December 12, 2014 22:29
Quora Hackathon - Archer - C++
// https://www.hackerrank.com/contests/quora-haqathon/challenges/archery
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#define min(a, b) (a < b ? a : b)
#define max(a, b) (a > b ? a : b)
const int bufferSize = 256;
const int numParams = a_thread-&gt;GetNumParams();
int len = 0;
int size = 0;
int ret = -1;
char* str = NULL;
char buffer[bufferSize] = { 0 };
// grab all the relevant constants
const int bufferSize = 256;
const int numParams = a_thread-&gt;GetNumParams();
// split single-line declarations
int len = 0;
int size = 0;
int ret = -1;
// might as well zero-init the buffer
const int bufferSize = 256;
int len = 0, size = 0, i, ret = -1;
char * str = NULL, buffer[bufferSize];
// build the string
for(i = 0; i < a_thread->GetNumParams(); ++i)
{
gmConcat(a_thread->GetMachine(), str, len, size, a_thread->Param(i).AsString(a_thread->GetMachine(), buffer, bufferSize), 64);
if(str)
set nocompatible
set esckeys
set hidden
set ruler
set visualbell
set showcmd
set wildmenu
set noerrorbells
set noexpandtab
set nostartofline
# Mostly generated from this:
# http://randomartifacts.blogspot.com.au/2012/10/a-proper-cygwin-environment.html
# Return immediately if we are not interactive
[ -z "$PS1" ] && return
# get current git branch name
{
"animation_enabled": false,
"bold_folder_labels": true,
"caret_style": "solid",
//"color_scheme": "Packages/User/Monokai (SL).tmTheme",
"font_size": 9,
"highlight_line": false,
"ignored_packages":
[
//"Vintageous",
@kalineh
kalineh / Default (Windows).sublime-keymap
Last active December 8, 2020 18:24
Sublime Text - Windows Keymap
[
// custom keys
{ "keys": [ "f7", ], "command": "build", },
{ "keys": [ "f5", ], "command": "build", "args": { "variant": "Run" } },
{ "keys": [ "ctrl+alt+o", ], "command": "show_panel", "args": { "panel": "output.exec", }, },
{ "keys": [ "ctrl+,", ], "command": "focus_group", "args": { "group": 0, }, },
{ "keys": [ "ctrl+.", ], "command": "focus_group", "args": { "group": 1, }, },
{ "keys": [ "ctrl+shift+,", ], "command": "move_to_group", "args": { "group": 0, }, },
{ "keys": [ "ctrl+shift+.", ], "command": "move_to_group", "args": { "group": 1, }, },
{ "keys": [ "ctrl+shift+/", ], "command": "move_to_group", "args": { "group": 2, }, },
@kalineh
kalineh / pch
Last active December 22, 2015 06:29
Header for intended use as pre-compiled header. Includes C++ standard libraries and platform headers. Force include + use as precompiled-header.
#define _PCH_LIBC
#define _PCH_WINDOWS_H
#define _PCH_EXTLIB
#ifdef _PCH_LIBC
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>