Skip to content

Instantly share code, notes, and snippets.

View lajlev's full-sized avatar

Michael Lajlev lajlev

View GitHub Profile

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>
@lajlev
lajlev / wp-file-permissions.md
Created January 3, 2014 10:41
Set Wordpress file permissions an FS method on localhost

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/
@lajlev
lajlev / gist:6267234
Last active December 21, 2015 06:49
mark autocomplete error
### "mark" functionality http://jeroenjanssens.com/2013/08/16/quickly-navigate-your-filesystem-from-the-command-line.html
export MARKPATH=$HOME/.marks
function jump {
cd -P "$MARKPATH/$1" 2>/dev/null || echo "No such mark: $1"
}
function mark {
mkdir -p "$MARKPATH"; ln -s "$(pwd)" "$MARKPATH/$1"
}
function unmark {
rm -i "$MARKPATH/$1"