Skip to content

Instantly share code, notes, and snippets.

View lajlev's full-sized avatar

Michael Lajlev lajlev

View GitHub Profile
@lajlev
lajlev / .bash_function
Created May 14, 2015 13:52
WP-CLI create bash function
wp-create() {
wp core download
git init
gi wordpress >> .gitignore
mysql -uroot -proot -e "create database $1;"
wp core config --dbname=$1 --dbuser=root --dbpass=root
wp core install --url=http://$1.wp --title=$1 --admin_user=lajlev --admin_password=7913 [email protected]
}
@lajlev
lajlev / ebert.rb
Created December 16, 2014 09:09
How do I capitalize the words?
#!/usr/bin/ruby
tmp = "{query}"
# If there was a query, then parse the query
unless tmp.nil? || tmp == 0
args = tmp.split
num = args.at(0)
char_limit = args.at(1)
else

Keybase proof

I hereby claim:

  • I am lajlev on github.
  • I am lajlev (https://keybase.io/lajlev) on keybase.
  • I have a public key whose fingerprint is 0CCE 9020 6843 944A 325C FBBE F930 C27C 3BAF 7BBE

To claim this, I am signing this object:

@lajlev
lajlev / Gruntfile.js
Last active August 29, 2015 14:10
Script to optimize & combine SVG files
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt)
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
svgmin: {
dist: {
expand: 'true',
@lajlev
lajlev / fetch-pixels.bash
Created November 26, 2014 15:12
Bash function to fetch pixel width and height of images.
function pixels() {
echo -e "w x h | $(sips -g pixelWidth $1 | tail -n1 | cut -d" " -f4) x $(sips -g pixelHeight $1 | tail -n1 | cut -d" " -f4)"
}
@lajlev
lajlev / .bash_profile
Last active August 29, 2015 14:07
Lazy git commit function
function m(){
git add . -A
if [ -z "$1" ]
then
N=0
COMMITS=('Feature' 'Hotfix' 'Visual improvement' 'Various changes')
for i in "${COMMITS[@]}"
do
N=`expr $N + 1`
echo "[${N}] ${i}"
@lajlev
lajlev / trial-expired.css
Created June 20, 2014 09:33
css overlay body - trial expired
body.expired:before {
content: "";
display: block;
width: 100%;
height: 100%;
position: absolute;
top: 0;
z-index: 9999;
@lajlev
lajlev / tweaks.txt
Created February 13, 2014 12:17
CfDP chat widget tweaks
Remove
<div class="status-header">Chat</div>
<div class="status-tab chat-open">Open</div>
Move
<a id="join-pair-chat" class="btn btn-success pairchat hide" href="#" style="display: inline;">Enter</a>
@lajlev
lajlev / delete_server_generated_files.php
Created February 10, 2014 15:01
PHP script to delete server generated files and folder
<?php
########################################################
# delapacheuserfiles.php
#
# Author: Claudio Kuenzler
# Company: Nova Company GmbH www.novacompany.ch
# Purpose: Deletes files and folders created by Apache user
#
# Version History
@lajlev
lajlev / .htaccess
Created January 30, 2014 09:20
Attempt to load files from production if they're not in our local version. Copy to your local version sites/default/.htaccess
# Attempt to load files from production if they're not in our local version. Put this file in upload folder.
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*) http://cyberhus.dk/sites/default/files/$1
</IfModule>