Skip to content

Instantly share code, notes, and snippets.

View kvandake's full-sized avatar
🏠
Working from home

Alexey Nikitin kvandake

🏠
Working from home
View GitHub Profile
@nphmuller
nphmuller / MyDbContext.cs
Last active February 1, 2024 23:20
CombineQueryFilers
public class MyDbContext : DbContext
{
private ITenantIdLocator tenantIdLocator;
public MyDbContext(ITenantIdLocator tenantIdLocator)
{
if (tenantIdLocator == null) throw new ArgumentNullException(nameof(tenantIdLocator));
this.tenantId = tenantIdLocator.GetTenantId();
}
@leemour
leemour / carrierwave_selectel.rb
Last active July 1, 2021 10:37
Carrierwave integration with Selectel using fog-openstack
CarrierWave.configure do |config|
if Rails.env.test? || Rails.env.cucumber?
config.storage = :file
config.enable_processing = false
else
config.asset_host = Rails.application.secrets.asset_host
config.fog_provider = 'fog/openstack'
config.fog_credentials = {
provider: 'OpenStack',
openstack_auth_url: 'https://api.selcdn.ru/v3',
@s-lyn
s-lyn / MANUAL.md
Created September 15, 2017 10:27
Deploy nodejs app with gitlab.com and pm2

Deploy nodejs app with gitlab.com and pm2

This manual is about setting up an automatic deploy workflow using nodejs, PM2, nginx and GitLab CI. It is tested on:

  • Target server: Ubuntu 16.04 x64. This is suitable for Ubuntu 14.x.
  • Windows 10 on my PC to work.
@rudyryk
rudyryk / Countdown.cs
Last active November 1, 2020 23:46
C# — countdown timer with periodical ticks + Xamarin.Forms binding helper + Basic usage example
//
// Countdown.cs
// Created by Alexey Kinev on 11 Jan 2015.
//
// Licensed under The MIT License (MIT)
// http://opensource.org/licenses/MIT
//
// Copyright (c) 2015 Alexey Kinev <alexey.rudy@gmail.com>
//
using System;
@HeathHopkins
HeathHopkins / ExtensionMethods.cs
Last active April 27, 2022 13:33
Xamarin.iOS Extension Methods
using System;
using MonoTouch.UIKit;
namespace System
{
public static class ExtensionMethods
{
public static UIColor ToUIColor(this string hexString)
{
hexString = hexString.Replace("#", "");
@jaymiejones86
jaymiejones86 / rails_website_launch_checklist.md
Last active January 18, 2021 17:51
Rails Website Launch Checklist

Ruby on Rails Website Launch Checklist

Copy this gist and customise it to your liking.

  • Run Brakeman and resolve any issues where required
  • Run rails best practices and resolve any warnings
  • Run full test suite and make sure all tests are passing
  • Make sure no dummy email addresses are left in any notification emails (eg contact form)
  • Make sure production assets compile correct (eg files in vendor, etc, compile and are not 404'ing in production environment)
  • If using unicorn in production, make sure deploys are restarting the unicorns
@jaymiejones86
jaymiejones86 / setup.md
Last active January 17, 2018 18:21
My Average Rails App Setup

The Average Rails App Setup

Below outlines what is setup with my average rails app

Services

  • Digital Ocean/AWS Server/Heroku
  • AWS S3
  • Heroku Postgres
  • Skylight
@kapkaev
kapkaev / gist:4619127
Created January 24, 2013 09:30
MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error. Resque
$ redis-cli
> config set stop-writes-on-bgsave-error no