Skip to content

Instantly share code, notes, and snippets.

View SeriousM's full-sized avatar
🌟
Focusing

Bernhard Millauer SeriousM

🌟
Focusing
View GitHub Profile
@SeriousM
SeriousM / 0_reuse_code.js
Created February 10, 2014 11:50
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@SeriousM
SeriousM / gist:9178584
Created February 23, 2014 23:00
Brackets Auto-Complete Error
var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create, update: update });
var s;
function create() {
game.physics.setBoundsToWorld(true, true, true, false);
s = game.add.tileSprite(0, 0, 800, 600, 'starfield');
@SeriousM
SeriousM / example.html
Last active August 29, 2015 14:01
get executing script tag
<script>
/* another block */
</script>
<script data-test-value="xyz">
//http://stackoverflow.com/a/2954896
// this works because the processing of script blocks is serial
// and others does not exist in that moment of execution.
// works with script-references
// does NOT work with async's
var toArray =Array.prototype.slice;
@SeriousM
SeriousM / OnOffModelBinder.cs
Created May 9, 2014 07:40
Custom C# ModelBinder
using System.Web.Mvc;
/// <summary>
/// This model binder converts the value "on" to true.
/// It's necessary for form-checkboxes (bootstrap) that sends "on" instead a boolean value
/// </summary>
public class OnOffModelBinder : IModelBinder
{
public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
{
@SeriousM
SeriousM / parameterDirections.sql
Created May 12, 2014 11:58
Sql Example of parameter directions in combination with C#
if exists(select * from sys.procedures where name = 'test_proc')
begin
drop procedure test_proc
end
go
create procedure test_proc
@in int,
@out int output,
@inout int output
@SeriousM
SeriousM / dump_restore.md
Last active August 29, 2015 14:03
Dump / Restore Meteor Mongo DB

DUMP

HOST=yournal.meteor.com
CMD=`meteor mongo $HOST --url | tail -1 | sed 's_mongodb://\([a-z0-9\-]*\):\([a-f0-9\-]*\)@\(.*\)/\(.*\)_mongodump -u \1 -p \2 -h \3 -d \4_'`
$CMD -o /path/to/dump

RESTORE

@SeriousM
SeriousM / readme.md
Last active August 29, 2015 14:04
Fixing Meteor/Meteorite Updates

removing meteor (usually not needed!)

# user settings
sudo rm /usr/local/bin/meteor

#meteor installation
rm -rf ~/.meteor

removing meteorite

@SeriousM
SeriousM / readme.md
Created August 6, 2014 11:26
Unix Symbolic Link

To create a symbolic link, the syntax of the command is similar to a copy or move command: existing file first, destination file second. For example, to link the directory /export/space/common/archive to /archive for easy access, use:

ln -s /export/space/common/archive /archive

To link the runtime control script /etc/init.d/httpd to /etc/rc2.d/S77httpd, use:

cd /etc/rc2.d ln -s ../init.d/httpd S77httpd
@SeriousM
SeriousM / readme.md
Last active August 29, 2015 14:04
Debugging / Fixing Meteor Packages
@SeriousM
SeriousM / 2012-and-later.sql
Created August 13, 2014 13:37
TSQL Rethrow Exception
BEGIN TRY
...
END TRY
BEGIN CATCH
ROLLBACK TRANSACTION;
THROW;
END CATCH