Skip to content

Instantly share code, notes, and snippets.

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

David Lonjon davidlonjon

🏠
Working from home
View GitHub Profile
/* Taken from http://robertnyman.com/2010/01/11/css-background-transparency-without-affecting-child-elements-through-rgba-and-filters/ */
.alpha60 {
/* Fallback for web browsers that doesn't support RGBa */
background: rgb(0, 0, 0);
/* RGBa with 0.6 opacity */
background: rgba(0, 0, 0, 0.6);
/* For IE 5.5 - 7*/
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000);
/* For IE 8*/
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";
// NOTE: I added the .js extension to this gist so it would have syntax highlighting. This file should have NO file extension
{
// Settings
"passfail" : false, // Stop on first error.
"maxerr" : 100, // Maximum error before stopping.
// Predefined globals whom JSHint will ignore.
"browser" : true, // Standard browser globals e.g. `window`, `document`.

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods
// Transparent Background
// From: http://stackoverflow.com/questions/6902944/sass-mixin-for-background-transparency-back-to-ie8
// Extend this class to save bytes
.transparent-background {
background-color: transparent;
zoom: 1;
}
// The mixin
@davidlonjon
davidlonjon / gist:5dbe61f4c3ddecd5ce73
Created July 11, 2014 05:32
Mobile Menu Button in Pure CSS
// Taken from http://www.alwaystwisted.com/post.php?s=2012-05-12-create-a-pure-css-menu-button
.btn {
position: relative;
margin-top:2%;
border: 2px solid black;
border-radius: 2px;
height: 36px;
width:36px;
}
# Default settings that all others account inherit
defaults
auth on
tls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
# Logging - uncomment either syslog or logfile, having both uncommented disables logging at all.
#syslog on
# Or to log to log own file
logfile /var/log/msmtp.log
@davidlonjon
davidlonjon / gist:811e610e36568353e214
Last active August 29, 2015 14:03
web server - iptables firewall rules
*filter
# Base policy: Allow outgoing traffic and disallow any passthroughs
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]
# Accepts all established inbound connections
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT -m comment --comment "allow already established connections"
@davidlonjon
davidlonjon / gist:cc542ef54c35af2c637a
Last active August 29, 2015 14:03
iptables useful commands and info
# Cleaning rules
iptables -F // flush all chains
iptables -A INPUT -i eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A INPUT -i lo -j ACCEPT
iptables -t nat -F
iptables -t mangle -F
iptables -X // delete all chains
# install persistent iptables
sudo apt-get install -y iptables-persistent

Set Wordpress file permissions and FS method on localhost

On Mac OS X (Leopard), the Apache HTTP Server runs under the user account, _www which belongs to the group _www. To allow WordPress to configure wp-config.php during installation, update files during upgrades, and update the .htaccess file for pretty permalinks, give the server write permission on the files.

One way to do this is to change the owner of the wordpress directory and its contents to _www. Keep the group as staff, a group to which your user account belongs and give write permissions to the group.

Step 1

$ cd //Sites/