Skip to content

Instantly share code, notes, and snippets.

View dminchev's full-sized avatar

Dobromir Minchev dminchev

View GitHub Profile
@aganov
aganov / macos-station.md
Last active April 12, 2018 08:19
Bootstrap

Install minio

brew install minio
vim /usr/local/etc/minio/config.json
{
 "version": "20",
@remoharsono
remoharsono / get_dom_path.js
Last active September 12, 2021 14:25
get dom path in pure js that return a jQuery path
/*
sample usage:
var path = getDomPath(element);
console.log(path.join(' > '));
output:
body > section:eq(0) > div:eq(3) > section#content > section#firehose > div#firehoselist > article#firehose-46813651 > header > h2 > span#title-46813651
taken from:
http://stackoverflow.com/questions/5728558/get-the-dom-path-of-the-clicked-a
# rails generate migration change_to_utf8mb_encoding
class ChangeToUtf8mbEncoding < ActiveRecord::Migration
# def execute(text)
# puts text
# end
def db
ActiveRecord::Base.connection
end
@anotheruiguy
anotheruiguy / web-fonts-asset-pipeline.md
Last active May 24, 2023 22:08
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.

@plentz
plentz / nginx.conf
Last active April 24, 2024 11:15
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@joequery
joequery / gist:1640945
Created January 19, 2012 16:19
Nginx individual site config for multiple rails apps with Unicorn
##############################################################
# Upstream must have unique name and unique socket. #
# The socket must match what is in the app's unicorn.rb file #
##############################################################
upstream railsapp1_server {
server unix:/tmp/railsapp1.sock fail_timeout=0;
}
##############################
# Rewrite www to non-www #
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@irae
irae / _Stay_standalone.md
Last active January 29, 2024 12:38 — forked from kylebarrow/example.html
Stay Standalone: Prevent links in standalone web apps opening Mobile Safari

#Stay Standalone

A short script to prevent internal links to a "webapp" added to iPhone home screen to open in Safari instead of navigating internally.

Git на практика - част 1

Лекцията цели да представи бързо набралата популярност дистрибутирана система за source control. Ще инсталираме гит (на който няма). Ще демонстрираме с практически примери основните команди, както и с какво git се различава от централизираните системи (subversion, cvs, vss). Ако пък случайно има хора, които не са убедени в ползата от сорс контрол, ще поговорим защо това е необходимо. Носете си компютър.

Първа част има за цел да представи употребата на гит "еднолично" (сиреч, на един компютър). Във втора част, ако стане, ще говорим за това как да ползваме гит в екип.

Инсталация на (линукс, OS X, Windows)

Нашето първо repository

We couldn’t find that file to show.