Skip to content

Instantly share code, notes, and snippets.

View datawebbie's full-sized avatar

Francis Park datawebbie

  • Greenpeace
  • Auckland, New Zealand
View GitHub Profile
/*Transparent pattern placed over an image, like we see on the bootstrap homepage: http://twitter.github.com/bootstrap/index.html*/
div {
width: 200px;
height: 200px;
display: block;
position: relative;
background: url(images/background-image.png);
}
@datawebbie
datawebbie / css-patterns
Created May 22, 2014 13:03
Frequently used css patterns
# 4x4 diagoal square
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAHklEQVQIW2NkYGDwAWIQ2AIiGLEJQBVAVIJUoAgAAGyyAp1vUYNUAAAAAElFTkSuQmCC");
# 2x2 dot
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAD0lEQVQIW2NkgAJGKP0fAAEsAQJ84W2vAAAAAElFTkSuQmCC");
@datawebbie
datawebbie / gist:045e9f1d1f7bb456e35b
Created June 30, 2014 18:04
Plesk 11.5 disable cron logrotate email
please follow the provided instructions:
#cat /etc/cron.daily/logrotate
#!/bin/sh
/usr/sbin/logrotate /etc/logrotate.conf
EXITVALUE=$?
if [ $EXITVALUE != 0 ]; then
/usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
fi
@datawebbie
datawebbie / middleman-project-setup
Last active August 29, 2015 14:05
Middleman project setup
cd project_directory
middleman init (bundle exec middleman init won't work because you don't have a Gemfile yet, middleman init will create one for you)
# Edit .gitignore file suit your new setting (be sure to include these at least)
/build
/.sass-cache
/.cache
.DS_Store
# Edit Gemfile (add gem "bitballoon" if you are using BitBalloon)
@datawebbie
datawebbie / vagrant_docker_setup
Created October 29, 2014 22:34
Creating agile development environment with Vagrant and Docker.
# Install VirtualBox from official website - https://www.virtualbox.org/wiki/Downloads
# Download Vagrant and install - http://www.vagrantup.com/downloads.html
# Do normall App install on Mac for both
# Download Vagrant box images from here - http://www.vagrantbox.es/
# Or use local boxes if you already have them
# Adding vg alias to ~/.bash_profile
alias vg='vagrant'

Vagrant + CoreOS + Dockerを利用した開発環境セットアップ

MacOSX + Vagrant + CoreOS + Docker + Ubuntuの環境。

2014年6月11日時点での情報。

  • Version: CoreOS 343.0.0
  • Kernel: 3.14.5
  • Docker: 1.0

Vagrant Docker

If you are build a saas, using VMs and management tools. You will find vagrant is useful for additional features.

But Virtual machines take too much time to load. Now there is a new trending called using docker. Docker is written in go, if you haven't heard of, you should probably go to check it out. In this article I am going to run a docker container in vagrant virtual machine

What is vagrant

Vagrant is a tool for building complete development environments. With an easy-to-use workflow and focus on automation, Vagrant lowers development environment setup time, increases development/production parity, and makes the "works on my machine" excuse a relic of the past.

@datawebbie
datawebbie / README.md
Last active August 29, 2015 14:08 — forked from nicerobot/README.md
Mac OS X uninstall script for packaged install of node.js

To run this, you can try:

curl -ks https://gist.github.com/nicerobot/2697848/raw/uninstall-node.sh | bash

I haven't tested this script doing it this way but i run a lot of my Gists like this so maybe this one'll work too.

Alternatively,

curl -ksO https://gist.github.com/nicerobot/2697848/raw/uninstall-node.sh

chmod +x ./uninstall-node.sh

@datawebbie
datawebbie / how-to-do-things-on-mac
Last active August 29, 2015 14:09
Mac OS X web dev setup stuff
# Apache config reload (on Linux /etc/init.d/apache2 reload)
sudo apachectl -k gradeful
# Check Apache config error
apachectl configtest
# port check (if no nmap, brew cask install nmap)
nmap 127.0.0.1
@datawebbie
datawebbie / generate-salt-random-string.php
Last active August 29, 2015 14:11
PHP function for generating random string with given length
/**
* This code was forked from http://online-code-generator.com/generate-salt-random-string.php
*/
<?php
function genKey($length) {
if($length > 0) {
$rand_id="";
for($i=1; $i <= $length; $i++) {