Skip to content

Instantly share code, notes, and snippets.

View gayanvirajith's full-sized avatar
:octocat:

Gayan Virajith gayanvirajith

:octocat:
View GitHub Profile
@gayanvirajith
gayanvirajith / allow.ftp.sh
Created September 18, 2014 06:09
Allow ftp from iptables
iptables -I INPUT 1 -p tcp --dport ftp -j ACCEPT
@gayanvirajith
gayanvirajith / Rakefile
Created October 26, 2014 18:55
Jekyll with both the default config _config.yml and an extra one, like _config-dev.yml
require 'rake'
desc 'Preview the site with Jekyll'
task :preview do
sh "jekyll serve --config _config.yml,_config-dev.yml --watch --drafts --baseurl '' "
end
@gayanvirajith
gayanvirajith / ProcessCarClassified.css
Created October 28, 2014 11:58
Car classified process module
ul.menu {
padding: 2em 0;
width: 100%;
}
ul.menu li {
display: inline;
margin-right: 10px;
}
ul.menu li a {
border: 1px solid #db1174;
@gayanvirajith
gayanvirajith / gulpfile.js
Created December 18, 2014 08:37
Gulp image minify
var gulp = require('gulp'),
imagemin = require('gulp-imagemin');
var pngcrush = require('imagemin-pngcrush');
// Gulp task - images
gulp.task('images', function() {
gulp.src('images/**')
.pipe(imagemin({ optimizationLevel: 3, progressive: true, interlaced: true, use: [] }))
.pipe(gulp.dest('min/'));
});
@gayanvirajith
gayanvirajith / _mixins.scss
Created March 10, 2015 17:10
CSS Flex grid items - centered using justify-content property
@mixin flexbox() {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
}
@mixin flex($values) {
-webkit-box-flex: $values;
@gayanvirajith
gayanvirajith / line-scooter.svg
Created March 11, 2015 18:46
SVG animateMotion example
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gayanvirajith
gayanvirajith / phpbrew-notes.md
Last active August 29, 2015 14:20
phpbrew notes

Switch php version of apache

Edit /etc/apache2/mods-enabled/php5.load update the php so file

Enable gd

sudo phpbrew install php-5.4.33 +default +mysql +intl +gettext +exif +fileinfo +zlib +ftp +iconv +gd +apxs2 -- --with-libdir=lib/x86_64-linux-gnu --with-gd=shared --enable-gd-natf --with-jpeg-dir=/usr --with-png-dir=/usr

php use 5.4xx

@gayanvirajith
gayanvirajith / git-help.md
Last active August 29, 2015 14:21
Git commands that we can used frequently

The way you git ignore watching/tracking a particular dir/file. you just run this:

git update-index --assume-unchanged <file>

The way you git undo ignore watching/tracking a particular dir/file:

git update-index --no-assume-unchanged <file>

To get a list of dir's/files that are assume-unchanged run this:

@gayanvirajith
gayanvirajith / git-commands.md
Last active August 29, 2015 14:22
switch branch without detaching head
@gayanvirajith
gayanvirajith / enable-ssh-on-ubuntu.md
Last active August 29, 2015 14:23
Enable ssh on ubuntu

Enable ssh on ubuntu

How do I configure a new Ubuntu installation to accept ssh connections?

Credit link

sudo apt-get update

sudo apt-get install openssh-server