Skip to content

Instantly share code, notes, and snippets.

View voleoo's full-sized avatar
๐Ÿ 
Working from home

Viktor Leonets voleoo

๐Ÿ 
Working from home
View GitHub Profile
@mattiaslundberg
mattiaslundberg / Ansible Let's Encrypt Nginx setup
Last active January 30, 2025 19:01
Let's Encrypt Nginx setup with Ansible
Ansible playbook to setup HTTPS using Let's encrypt on nginx.
The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS.
The server pass A rating on [SSL Labs](https://www.ssllabs.com/).
To use:
1. Install [Ansible](https://www.ansible.com/)
2. Setup an Ubuntu 16.04 server accessible over ssh
3. Create `/etc/ansible/hosts` according to template below and change example.com to your domain
4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder)
@chbrown
chbrown / _upgrade-pg9.4-to-pg9.5.md
Last active October 7, 2021 13:57
Upgrade PostgreSQL 9.4 to 9.5 on Mac OS X with Homebrew

First, check your current config (example output in homebrew.mxcl.postgresql.plist.xml lower down in this gist):

cat ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

Most importantly, note the -D /usr/local/var/postgres argument.

Second, shut down your current PostgreSQL.

launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
@obfusk
obfusk / break.py
Last active December 7, 2024 13:12
python "breakpoint" (more or less equivalent to ruby's binding.pry); for a proper debugger, use https://docs.python.org/3/library/pdb.html
import code; code.interact(local=dict(globals(), **locals()))
@geelen
geelen / app.coffee
Created April 8, 2013 01:46
My way for including Rails' CSRF token in AngularJS client code
# Set up the application
app = angular.module('ratingRampage', [])
# This is an injectable property
app.value 'Authentication', {}
# Add a directive so that if we see a csrf-token attribute, this gets set
app.directive 'csrfToken', (Authentication) ->
(scope, element, attrs) ->
Authentication.csrf_token = attrs.csrfToken
@vvakame
vvakame / jquery.tokeninput.js-with-angular.js.html
Created February 20, 2013 01:41
jquery.tokeninput.js http://loopj.com/jquery-tokeninput/ ใจangular.js ใ‚’็ต„ใฟๅˆใ‚ใ›ใฆไฝฟใ†ใซใฏใฉใ†ใ—ใŸใ‚‰ใ„ใ„ใฎใ‹ใชใ€‚ใจๆ€ใฃใฆ่ฉฆไฝœใ—ใฆใฟใŸใ€‚ใชใ‚“ใจใชใangular.jsใฎๆตๅ„€ใซๅใ—ใฆใ„ใ‚‹ๆฐ—ใŒใ™ใ‚‹โ€ฆใ€‚
<!DOCTYPE html>
<html>
<head>
<title>jquery.tokeninput.js with angular.js</title>
<link rel="stylesheet" type="text/css" href="components/jquery-tokeninput/styles/token-input.css"/>
<link rel="stylesheet" type="text/css" href="components/jquery-tokeninput/styles/token-input-facebook.css"/>
<script type="text/javascript" src="components/jquery/jquery.js"></script>
<script type="text/javascript" src="components/jquery-tokeninput/src/jquery.tokeninput.js"></script>
@p1nox
p1nox / postgresql_configuration_on_ubuntu_for_rails.md
Last active July 20, 2024 11:55
PostgreSQL configuration without password on Ubuntu for Rails

Abstract

You could have postgre installed on localhost with password (or without user or password seted after instalation) but if we are developing we really don't need password, so configuring postgre server without password for all your rails project is usefull.

Install Postgre packages

  • postgresql
  • postgresql-client
  • libpq-dev
@seratch
seratch / config.yml
Created October 25, 2012 09:37
AWS SQS Example
access_key_id: xxx
secret_access_key: yyy
@alimd
alimd / gist:3344523
Created August 13, 2012 22:28
All github Emoji (Smiles)

All github Emoji (Smiles)

ali.md/emoji

:bowtie: | ๐Ÿ˜„ | ๐Ÿ˜† | ๐Ÿ˜Š | ๐Ÿ˜ƒ | โ˜บ๏ธ | ๐Ÿ˜ | ๐Ÿ˜ | ๐Ÿ˜˜ | :kissing_face: | ๐Ÿ˜ณ | ๐Ÿ˜Œ | ๐Ÿ˜† | ๐Ÿ˜ | ๐Ÿ˜‰ | :wink2: | ๐Ÿ‘… | ๐Ÿ˜’ | ๐Ÿ˜… | ๐Ÿ˜“

๐Ÿ˜ฉ | ๐Ÿ˜” | ๐Ÿ˜ž | ๐Ÿ˜– | ๐Ÿ˜จ | ๐Ÿ˜ฐ | ๐Ÿ˜ฃ | ๐Ÿ˜ข | ๐Ÿ˜ญ | ๐Ÿ˜‚ | ๐Ÿ˜ฒ | ๐Ÿ˜ฑ | :neckbeard: | ๐Ÿ˜ซ | ๐Ÿ˜  | ๐Ÿ˜ก | ๐Ÿ˜ค | ๐Ÿ˜ช | ๐Ÿ˜‹ | ๐Ÿ˜ท

๐Ÿ˜Ž | ๐Ÿ˜ต | ๐Ÿ‘ฟ | ๐Ÿ˜ˆ | ๐Ÿ˜ | ๐Ÿ˜ถ | ๐Ÿ˜‡ | ๐Ÿ‘ฝ | ๐Ÿ’› | ๐Ÿ’™ | ๐Ÿ’œ | โค๏ธ | ๐Ÿ’š | ๐Ÿ’” | ๐Ÿ’“ | ๐Ÿ’— | ๐Ÿ’• | ๐Ÿ’ž | ๐Ÿ’˜ | โœจ

@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"