Skip to content

Instantly share code, notes, and snippets.

View martianboy's full-sized avatar
👽

Abbas Mashayekh martianboy

👽
  • Rechat
  • Toronto, Canada
View GitHub Profile
@timabell
timabell / vs-bash-console.bat
Created May 7, 2012 11:59
batch script for loading git-bash and the vs tools in the same window
@echo off
REM batch script for loading git-bash and the vs tools in the same window
REM inspiration: http://www.drrandom.org/post/2011/11/16/Grappling-with-multiple-remotes-in-git-tfs.aspx
RME screenshot: https://twitter.com/#!/tim_abell/status/199474387731226624/photo/1
%HOMEDRIVE%
cd %HOMEPATH%
call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86
echo Use full exe names when running under bash, e.g. "msbuild.exe"
echo Loading bash, you may now use git and msbuild in the same console \o/.
"C:\Program Files (x86)\Git\bin\sh.exe" --login -i
@aaronzirbes
aaronzirbes / shrink-git-repo.sh
Created January 19, 2013 05:32
This script will help you remove large files from your git repo history and shrink the size of your repository.
#!/bin/bash
echo "Finding and Purging Big Files From Git History"
echo "=============================================="
echo ""
echo "http://naleid.com/blog/2012/01/17/finding-and-purging-big-files-from-git-history/"
echo ""
pushd "$(git rev-parse --show-toplevel)" > /dev/null
@siongui
siongui / gist:4969449
Last active April 7, 2020 08:49
AngularJS safe $apply (prevent "Error: $apply already in progress")
$scope.safeApply = function(fn) {
var phase = this.$root.$$phase;
if(phase == '$apply' || phase == '$digest')
this.$eval(fn);
else
this.$apply(fn);
};
// OR
@remojansen
remojansen / class_decorator.ts
Last active September 14, 2023 14:54
TypeScript Decorators Examples
function logClass(target: any) {
// save a reference to the original constructor
var original = target;
// a utility function to generate instances of a class
function construct(constructor, args) {
var c : any = function () {
return constructor.apply(this, args);
}
@Nithanim
Nithanim / gist:766c31475377b0bd594bab974a1de8d2
Last active September 25, 2022 08:12
Northland/Nordland or 8th Wonder of the World/Weltwunder map.dat file format
<!-- mediawiki -->
<!-- Note: the decoding is not completely right because on bigger maps my parser crashes. For smaller maps it works though. -->
The map.dat has no index table at the beginning of the file. It rather uses entry-headers (called "hoix"es) that state what type of content the next block contains and how long it is. The byte-order is Little Endian.
== Hoix ==
A hoix denotes a header of a datablock in the map.dat. The file starts with this.
{| class="wikitable"