Skip to content

Instantly share code, notes, and snippets.

View urosgruber's full-sized avatar
🐢

Uros Gruber urosgruber

🐢
  • Squarebox
  • Slovenia
View GitHub Profile
IScrollable = Mn.Behavior.extend({
events: {
'scroll': _.throttle(function () { this.scrollHandler(); },500)
},
scrollHandler: function (e) {
if (this.bottomHited || this.areWeAtTheBottomNow(this.$el)) return;
this.scrollBottomHit();
},
@urosgruber
urosgruber / Remove portion of filename from list of files
Last active December 1, 2016 21:38
Remove portion of filename from list of files
## this will remove -fs8 from files like foobar1-fs8.png
for filename in *.png; do
[ -f "$filename" ] || continue
mv $filename ${filename//\-fs8/}
done
@urosgruber
urosgruber / Vagrantfile
Created October 21, 2015 17:38 — forked from jeebak/Vagrantfile
A vagrant replacement for ievms (for Linux, OSX, and Windows hosts)
# Usage: vagrant up windowsVersion-IEversion
#
# Eg. vagrant up xp-8
#
# Based off of: # https://gist.github.com/anthonysterling/7cb85670b36821122a4a
boxes = {
"xp-6" => "http://aka.ms/vagrant-xp-ie6",
"xp-8" => "http://aka.ms/vagrant-xp-ie8",
"vista-7" => "http://aka.ms/vagrant-vista-ie7",
"win7-8" => "http://aka.ms/vagrant-win7-ie8",
MyApp = new Backbone.Marionette.Application();
MyApp.addRegions({
mainRegion: "#content"
});
// Models
ShutterModel = Backbone.Model.extend({
urlRoot: "/api/shutters",
@urosgruber
urosgruber / gist:8b6c9b54db64a49b107b
Created September 27, 2014 18:45
FreeBSD install
#!/bin/sh
echo "Now type reboot, remove CD-ROM, etc."
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#
@urosgruber
urosgruber / 0_reuse_code.js
Created June 25, 2014 12:13
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
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#
# ---- Makefile for Vermaden's FreeBSD 9.1 root on ZFS manual install
# $Id: Makefile,v 1.18 2013/08/07 13:31:29 root Exp root $
#
# Copyright (c) 2013 Adriaan van Roosmalen <j65nko daemonforums.org>>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES