Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View VladoMS's full-sized avatar

Vladislav Stoyanov VladoMS

View GitHub Profile
@VladoMS
VladoMS / Enable-Transformations.md
Created January 12, 2017 13:21 — forked from EdCharbeneau/Enable-Transformations.md
How to enable transformations on build with Visual Studio

#Transform web.config on build

  1. Unload the project
  2. Edit .csproj
  3. Append figure 1 to the end of the file just before </Project>; v12.0 my change depending on your version of Visual Studio
  4. Save .csproj and reload
  5. Open configuration manager
  6. Add a new Configuration Name: Base. Copy settings from: Release
  7. Copy the contents of your web.config
  8. Right click Web.Config > Add Config Transformation
@VladoMS
VladoMS / docker-destroy-all.sh
Created December 6, 2016 22:48 — forked from JeffBelback/docker-destroy-all.sh
Destroy all Docker Containers and Images
#!/bin/bash
# Stop all containers
docker stop $(docker ps -a -q)
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
@VladoMS
VladoMS / HomeController.cs
Created September 30, 2016 20:09 — forked from ahmad-moussawi/HomeController.cs
A view Render for Razor (aspnetcore RC2)
public class HomeController : Controller {
private readonly ViewRender view;
public HomeController (ViewRender view) {
this.view = view
}
public string Test () {
// render ~/Views/Emails/ResetCode
@VladoMS
VladoMS / SimpleHttpClient.cs
Created August 22, 2016 16:52 — forked from bryanbarnard/SimpleHttpClient.cs
Simple C# .NET 4.5 HTTPClient Request Using Basic Auth and Proxy
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net.Http;
using System.Net;
namespace HTTP_Test
@VladoMS
VladoMS / web-fonts-asset-pipeline.md
Created August 8, 2016 14:19 — forked from anotheruiguy/web-fonts-asset-pipeline.md
Custom Web Fonts and the Rails Asset Pipeline

Web fonts are pretty much all the rage. Using a CDN for font libraries, like TypeKit or Google Fonts, will be a great solution for many projects. For others, this is not an option. Especially when you are creating a custom icon library for your project.

Rails and the asset pipeline are great tools, but Rails has yet to get caught up in the custom web font craze.

As with all things Rails, there is more then one way to skin this cat. There is the recommended way, and then there are the other ways.

The recommended way

Here I will show how to update your Rails project so that you can use the asset pipeline appropriately and resource your files using the common Rails convention.

@VladoMS
VladoMS / MenuBuilder.php
Created July 15, 2016 11:31 — forked from nateevans/MenuBuilder.php
KNP Menu Bundle with Bootstrap 3 and Font Awesome 4 (see http://bit.ly/1sd1rJr , thanks to Niels Mouthaan!)
<?php
namespace Acme\HelloBundle\Menu;
use Knp\Menu\FactoryInterface;
use Symfony\Component\DependencyInjection\ContainerAware;
class MenuBuilder extends ContainerAware
{
public function mainMenu(FactoryInterface $factory, array $options)
@VladoMS
VladoMS / nginx.conf
Created July 1, 2016 10:45 — forked from conorh/nginx.conf
Using Nginx as a caching proxy for Refile with Ruby on Rails
http {
...
proxy_cache_path /data/perch.squaremill.com/shared/image_cache levels=1:2 keys_zone=images:10m;
...
}
@VladoMS
VladoMS / gist:604f8acf75a119fdee0d7ee339440322
Created June 23, 2016 11:05 — forked from Atem18/gist:4696071
Tutorial to seting up a django website in production.

******************************************************************** Set up Django, Nginx and Gunicorn in a Virtualenv controled by Supervisor********************************************************************

Steps with explanations to set up a server using:

  • Virtualenv
  • Virtualenvwrapper
  • Django
  • Gunicorn
@VladoMS
VladoMS / package.json
Created June 7, 2016 20:08 — forked from addyosmani/package.json
npm run-scripts boilerplate
{
"name": "my-app",
"version": "1.0.0",
"description": "My test app",
"main": "src/js/index.js",
"scripts": {
"jshint:dist": "jshint src/js/*.js'",
"jshint": "npm run jshint:dist",
"jscs": "jscs src/*.js",
"browserify": "browserify -s Validating -o ./dist/js/build.js ./lib/index.js",
@VladoMS
VladoMS / SocialBase.php
Created May 20, 2016 15:10 — forked from Problematic/SocialBase.php
Working example of Symfony2 entities with Class Table Inheritance
<?php
namespace UP\SocialBundle\Entity;
/**
* UP\SocialBundle\Entity\SocialBase
* @orm:Entity
* @orm:HasLifecycleCallbacks
* @orm:InheritanceType("JOINED")
* @orm:DiscriminatorColumn(name="class_name", type="string")