Skip to content

Instantly share code, notes, and snippets.

View VladoMS's full-sized avatar

Vladislav Stoyanov VladoMS

View GitHub Profile
@VladoMS
VladoMS / gist:6148f02a4cb3cf2fbaaf
Created January 6, 2015 10:44
My user behaviors for Light Table.
;; User behaviors
;; -----------------------------
;; Behaviors are stored as a set of diffs that are merged together
;; to create the final set of functionality that makes up Light Table. You can
;; modify these diffs to either add or subtract functionality.
;;
;; Behaviors are added to tags, objects with those tags then automatically gain
;; whatever logic the behavior imparts. To see a list of user-level behaviors,
;; start typing a word related to the functionality you want in between the square
;; brackets (e.g. "theme").
#
# See also: http://almosteffortless.com/2008/12/11/easy-upload-via-url-with-paperclip/
#
# Allow "uploads via url" with Rails and Paperclip
#
# http://www.thoughtbot.com/projects/paperclip
# http://github.com/thoughtbot/paperclip/tree/master
# http://groups.google.com/group/paperclip-plugin/browse_thread/thread/456401eb93135095
#
# This example is designed to work with a "Photo" model that has an "Image" attachment
@VladoMS
VladoMS / deploy.rake
Last active August 29, 2015 14:21 — forked from njvitto/deploy.rake
#Deploy and rollback on Heroku in staging and production
task :deploy_staging => ['deploy:set_staging_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
task :deploy_production => ['deploy:set_production_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
namespace :deploy do
PRODUCTION_APP = 'YOUR_PRODUCTION_APP_NAME_ON_HEROKU'
STAGING_APP = 'YOUR_STAGING_APP_NAME_ON_HEROKU'
task :staging_migrations => [:set_staging_app, :push, :off, :migrate, :restart, :on, :tag]
task :staging_rollback => [:set_staging_app, :off, :push_previous, :restart, :on]
module Restaurant
include ActiveSupport::Configurable
config_accessor :title, :page_parts, :view_templates, :layout_parts, :custom_pages, :plugins, :structures
self.title = "Restaurant thema"
self.page_parts = [
{ name: 'header_photo', title: 'Header', page_partable_type: "Spina::Photo" },
{ name: 'background_photo', title: 'Achtergrond', page_partable_type: "Spina::Photo" },
# First, Install Vagrant and Virtualbox then:
# Create new project directory
mkdir -p ~/Sites/newproject # Create new project directory
mk ~/Sites/newproject # Go into your new project directory
# Setup Vagrant
vagrant init
# Edit vagrant file box and box url to install Ubuntu, just like https://gist.github.com/fideloper/dab171a2aa646e86b782#file-vagrantfile-share-var-www-rb-L6-L8
# Edit Vagrantfile to create a static IP address, just like https://gist.github.com/fideloper/dab171a2aa646e86b782#file-vagrantfile-share-var-www-rb-L10
@VladoMS
VladoMS / SortSearchExtensions.cs
Created November 27, 2015 08:52 — forked from mombrea/SortSearchExtensions.cs
Extension Methods for table sorting and search query
using System.Collections.Specialized;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
namespace My.App
{
public static class Extensions
{
/// <summary>
@VladoMS
VladoMS / 00000000000000_CreateIdentitySchema.Designer.cs
Created December 2, 2015 17:54
Problem with migrations on MVC6 RC-1
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Data.Entity;
using Microsoft.Data.Entity.Infrastructure;
using Microsoft.Data.Entity.Metadata;
using Microsoft.Data.Entity.Migrations;
using WebApplication2.Models;
#!/bin/bash
#start
#-----------------------------------------------------------------------
find /srv/backup/daily/databases/ -name '*.gz' -mtime +7 | xargs rm -f;
find /srv/backup/daily/websites/ -name '*.gz' -mtime +7 | xargs rm -f;
# Are Weekly Backups Implemented?
# find /srv/backup/weekly/ -name '*.gz' -mtime +30 | xargs rm -f;
#-----------------------------------------------------------------------
#end
<?php
namespace Application\DoctrineExtensions\DBAL\Types;
use Doctrine\DBAL\Types\DateTimeType;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\ConversionException;
class UTCDateTimeType extends DateTimeType
{
'router' => array(
'routes' => array(
'home' => array(
'type' => 'Zend\Mvc\Router\Http\Literal',
'options' => array(
'route' => '/',
'defaults' => array(
'controller' => 'Application\Controller\Index',
'action' => 'index',
),