Skip to content

Instantly share code, notes, and snippets.

@un1ko85
un1ko85 / fonts.styl
Last active August 29, 2015 14:18 — forked from diogomoretti/fonts.styl
// Fonts mixin
font-url(file)
return '../fonts/' + file
webfont(family, file, hack-chrome-windows = false, weight = 'normal')
@font-face
font-family family
src url(font-url(file + '.eot'))
src url(font-url(file + '.eot?#iefix')) format('embedded-opentype'),
url(font-url(file + '.woff')) format('woff'),
@un1ko85
un1ko85 / site.conf
Last active August 29, 2015 14:22 — forked from paskal/site.conf
# read more at https://terrty.net/2014/ssl-tls-in-nginx/
# latest version on https://gist.github.com/paskal/628882bee1948ef126dd/126e4d1daeb5244aacbbd847c5247c2e293f6adf
# security test score: https://www.ssllabs.com/ssltest/analyze.html?d=terrty.net
# your nginx version might not have all directives included, test this configuration before using in production against your nginx:
# $ nginx -c /etc/nginx/nginx.conf -t
server {
# public key, contains your public key and class 1 certificate, to create:
# (example for startssl)
# $ (cat example.com.pem & wget -O - https://www.startssl.com/certs/class1/sha2/pem/sub.class1.server.sha2.ca.pem) | tee -a /etc/nginx/ssl/domain.pem > /dev/null
@un1ko85
un1ko85 / sm-annotated.html
Created October 27, 2015 08:49 — forked from hdragomir/sm-annotated.html
The deferred font loading logic for Smashing Magazine. http://www.smashingmagazine.com/
<script type="text/javascript">
(function () {
"use strict";
// once cached, the css file is stored on the client forever unless
// the URL below is changed. Any change will invalidate the cache
var css_href = './index_files/web-fonts.css';
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
el.addEventListener(ev, callback, false);
@un1ko85
un1ko85 / nginx.conf
Created January 6, 2016 08:01
Rewrite URI with nginx and php-fpm. I have faced the problem that REQUEST_URI parameter is not changed on nginx rewrite rule. After some research I have found solution with replacing $request_uri variable.
server {
listen 80;
server_name site.dev;
index index.php;
root /Users/balkon_smoke/Sites/site.dev/web;
error_log /Users/balkon_smoke/Sites/site.dev/logs/error.log;
access_log /Users/balkon_smoke/Sites/site.dev/logs/access.log;
location / {
@un1ko85
un1ko85 / a.md
Created January 15, 2016 10:36 — forked from danharper/a.md
Laravel Queue Supervisor

Install Supervisor with sudo apt-get install supervisor. Ensure it's started with sudo service supervisor restart.

In /etc/supervisord/conf.d/ create a .conf file. In this example, laravel_queue.conf (contents below). Give it execute permissions: chmod +x laravel_queue.conf.

This file points at /usr/local/bin/run_queue.sh, so create that file there. Give this execute permissions, too: chmod +x run_queue.sh.

Now update Supervisor with: sudo supervisorctl reread. And start using those changes with: sudo supervisorctl update.

@un1ko85
un1ko85 / lets-encrypt-nginx.md
Created January 18, 2016 15:18 — forked from padde/lets-encrypt-nginx.md
Let's Encrypt with Nginx

Let's Encrypt with Nginx

Here's how I set up a tiny Nginx/Rails server that uses HTTPS via a Let's Encrypt issued certificate.

https://letsencrypt.paddd.de/

Server

I use the smallest DigitalOcean droplet (512 MB) here, which is built from the "Ubuntu Ruby on Rails on 14.04" image provided by them.

@un1ko85
un1ko85 / FreeBSD_node_monit.md
Created January 19, 2016 08:03 — forked from fdelbos/FreeBSD_node_monit.md
FreeBSD 10 Nodejs setup with nginx, mongo and monit

FreeBSD 10 Nodejs setup with nginx, mongodb, redis and monit

This my receipe for installing a complete nodejs server on FreeBSD 10. The parameters used in this configuration are for a very small private server that I use for demo purpose only, so for a production server, you should somehow set the limits in pair with your ressources.

I use monit so I don't have to write rc scripts for node and it should take care of process lifecycle management for me. Alternatives exists such as supervisord or circus.

Installing mongodb

@un1ko85
un1ko85 / dabblet.css
Created May 26, 2016 09:00 — forked from jankorbel/dabblet.css
CSS animated loading dots
/*
CSS animated loading dots
*/
body
{
background: #5A5C64;
}
.loading_dots
@un1ko85
un1ko85 / sendy-server
Created June 2, 2016 11:19 — forked from refringe/sendy-server
Nginx configuration file example for Sendy (http://sendy.co/).
server {
listen 80;
listen [::]:80;
server_name domain.com;
autoindex off;
index index.php index.html;
root /srv/www/domain.com/public;
@un1ko85
un1ko85 / gist:a8198494409772da6243c90e7f0087fe
Created November 1, 2016 09:43 — forked from Mikodes/gist:be9b9ce42e46c3d4ccb6
All Media queries for resolutions
/* (320x480) iPhone (Original, 3G, 3GS) */
@media only screen and (min-device-width: 320px) and (max-device-width: 480px) {
/* insert styles here */
}
/* (320x480) Smartphone, Portrait */
@media only screen and (device-width: 320px) and (orientation: portrait) {
/* insert styles here */
}