Skip to content

Instantly share code, notes, and snippets.

@artlesshand
artlesshand / headings-generator-s1.scss
Created November 16, 2015 07:48
Generate headings relatively with Sass
// whatever size and number suits you
$font-size: 1.2rem;
$i: 3;
@each $h in h6, h5, h4, h3, h2, h1 {
#{$h} {
font-size: $font-size + $i;
line-height: $font-size * 2 + $i;
font-weight: bold;
}
@artlesshand
artlesshand / btn-generator-s1.scss
Last active November 16, 2015 08:45
Generating buttons with Sass and a color list
$color-list: (
"white" : #FFF,
"black" : #000,
"red" : #BF6060,
"blue" : #159BC7,
"green" : #659826,
"sariinac" : #00979D,
"varchin" : #B0419E,
"darkvarchin" : #A7529D,
"vine" : #AD1336,
@SpekkoRice
SpekkoRice / checkPHPVersion
Last active July 21, 2020 07:40
Bash: Check the version of PHP
#!/bin/bash
# Function to check if the PHP version is valid
checkPHPVersion() {
# The current PHP Version of the machine
PHPVersion=$(php -v|grep --only-matching --perl-regexp "5\.\\d+\.\\d+");
# Truncate the string abit so we can do a binary comparison
currentVersion=${PHPVersion::0-2};
# The version to validate against
minimumRequiredVersion=$1;
@digitalresistor
digitalresistor / Alias_domains_vimbadmin.md
Last active November 4, 2015 22:25
Being able to have full alias domains with ViMbAdmin is fairly handy, in that it allows people to have multiple domains forward to a single domain. This isn't supported out of the box with ViMbAdmin, and thus needs to be kind of hacked in... I am using Postfix + with Dovecot for virtual mail delivery

After updating your main.cf and your Dovecot configuration you can now add alias domains to ViMbAdmin:

  1. Create new domain example.net which we want to alias to example.com
  2. Create new alias on example.net named *@example.net that forwards to *@example.com
  3. Test send an email to user@example.com and user@example.net and verify both messages are delivered successfully to user@example.com

Users can log in to Dovecot (IMAP/POP3/SMTP AUTH) using either example.net or example.com. If login fails to find the username/password combo on the first try, it will attempt to look it up in the alias table, and allow login if that succeeds. This way users can configure their mail clients however they please.

@akisvolanis
akisvolanis / defaults.yml
Last active October 15, 2020 18:12
Upload ssh key to gitlab for deploy user with ansible
deploy_user_name: 'deployer'
# More info about password: http://docs.ansible.com/faq.html#how-do-i-generate-crypted-passwords-for-the-user-module
# password created with: python -c "from passlib.hash import sha512_crypt; print sha512_crypt.encrypt('example_password')"
deploy_user_password: <encrypted_password>
user_shell: "/bin/bash"
deploy_user_home: "/home/{{ deploy_user_name }}"
repo_api_token: <your_api_token>
repo_project_id: <your_project_id>
@barryo
barryo / dovecot-10-auth.conf
Last active October 24, 2023 14:29
Configuration Files for ViMbAdmin on Ubuntu 13.10 with Dovecot and Postfix - referenced from https://github.com/opensolutions/ViMbAdmin3/wiki/Mail-System-Install-on-Ubuntu
auth_mechanisms = plain login
!include auth-sql.conf.ext
@zenorocha
zenorocha / .hyper.js
Last active November 12, 2023 15:13 — forked from millermedeiros/osx_setup.md
Setup macOS Sierra (10.12)
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 14,
// font family with optional fallbacks
@EHLOVader
EHLOVader / RFCEmail.md
Last active April 13, 2023 02:31
Like Grammar Nazis I have run into misguided attempts to validate or use emails in applications enough that I put together this standard RFC email speech that i give to websites which fail on gmail plus notation email formats. Normally nothing changes, but maybe one day they will forward it to the right people and they will fix it.

I would like to note that your website restricts and disallows absolutely valid email addresses, in particular mine. I respectfully request that you update your sites email checks to allow valid email addresses which may not be particularly regular, but are absolutely valid.

I have included the requirements for email addresses along with their standards reference in RFC definitions.

  1. An e-mail address consists of local part and domain separated by an at sign (@) character (RFC 2822 3.4.1).

  2. The local part may consist of alphabetic and numeric characters, and the following characters: !, #, $, %, &, ', *, +, -, /, =, ?, ^, _, `, {, |, } and ~, possibly with dot separators (.), inside, but not at the start, end or next to another dot separator (RFC2822 3.2.4).

  3. The local part may consist of a quoted string—that is, anything within quotes ("), including spaces (RFC 2822 3.2.5).

@RaVbaker
RaVbaker / gist:2967695
Created June 21, 2012 18:44
[HOWTO] Ubuntu 12.04 Ruby on Rails Development Environment

Ubuntu 12.04 Ruby on Rails Development Environment

I haven't set up an install guide for the latest ubuntu release, largely because the last set of instructions worked pretty closely with the latest and greatest Ubuntu, 12.04 Precise Pangolin, however when installing today, I found that there were enough differences in the way that I configure my setup to justify an update, so here it goes. Yes, I'm late to the party, but a quick google search didn't find anything that I felt was as complete for my requirements as my previous install guides, so here I go.

As always with my install guides, I have included here is just about everything you'll need (and then some) to get started with ruby on rails development with Ubuntu 12.04 as a platform. These are my settings and preferences, and this is certainly not the only way of doing things, so keep that in mind.

Step 1: Get the repos ready and run updates.

sudo apt-get update && sudo apt-get upgrade
@apk
apk / websock.sh
Created April 18, 2012 15:51
A web socket server as a bash script.
#!/bin/bash
# WebSocket shell, start & browse to http://<Host>:6655/
# Requires bash 4.x, openssl.
# Author: rootshell@corelogics.de (which isn't me, apk)
coproc d { nc -l -p 6656 -q 0; }
nc -l -p 6655 -q 1 > /dev/null <<-ENDOFPAGE
HTTP/1.1 200 OK
<html><head><script language="javascript">
var url = location.hostname + ':' + (parseInt(location.port) + 1);