Skip to content

Instantly share code, notes, and snippets.

View madalinignisca's full-sized avatar
🏡
Open for business

Madalin Ignisca madalinignisca

🏡
Open for business
View GitHub Profile
@madalinignisca
madalinignisca / post-receive
Created August 10, 2016 07:03
git post-merge hook : update / install composer packages & composer itself
#!/bin/bash
# thanks http://www.jenssegers.be/blog/46/deploying-websites-with-git-and-composer-
# replace folder
cd "`dirname $0`/../../application/config"
# Check if a composer.json file is present
if [ -f composer.json ]; then
@madalinignisca
madalinignisca / .gitignore
Created June 23, 2016 13:14
Up2date Gitignore 4 WordPress
# Created by https://www.gitignore.io/api/wordpress
### WordPress ###
*.log
wp-config.php
wp-content/advanced-cache.php
wp-content/backup-db/
wp-content/backups/
wp-content/blogs.dir/
wp-content/cache/
@madalinignisca
madalinignisca / readme.markdown
Last active August 24, 2022 06:10 — forked from larrybotha/readme.markdown
Postfix Using Mailhog to capture email for web development

Configure Postfix for Localhost SMTP in Mac OSX Mavericks with Mailhog

Using Homebrew install mailhog and enable the service as instructed in the installation.

Open in any browser http://localhost:8025

Edit file /etc/postfix/main.cf

sudo vim /etc/postfix/main.cf
@madalinignisca
madalinignisca / router.php
Created April 13, 2016 13:40
basic PHP router for built in server
<?php
if (!file_exists(__DIR__ . '/' . $_SERVER['REQUEST_URI'])) {
$_GET['_url'] = $_SERVER['REQUEST_URI'];
}
return false;
lucasta $ composer require -vvv friendsofcake/crud-view
You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug
Reading ./composer.json
Loading config file /Volumes/Data/Users/m/.composer/config.json
Loading config file /Volumes/Data/Users/m/.composer/auth.json
Loading config file ./composer.json
Checking CA file /private/var/folders/6x/ff39wr016ys25ffbp8xwzd9c0000gn/T/composer-cacert-39eaf16e26c08cc90d728865f1c60406ee5d864d5963f72ede2a1cbb127f95ca.pem
Executing command (/Volumes/Data/Users/m/Documents/Workspace/projects/www/lucasta): git branch --no-color --no-abbrev -v
Failed to initialize global composer: Composer could not find the config file: /Volumes/Data/Users/m/.composer/composer.json
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
@madalinignisca
madalinignisca / README.md
Last active March 2, 2016 09:49
Bootstrap Burger animated icon to X
@madalinignisca
madalinignisca / README.md
Created October 22, 2015 08:09
Yii serve using PHP's built in server

Found this on Yii wiki: Yii 2.0: PHP built-in server integration

Really cool and my default when working with Yii.

Place the ServeController.php file in "commands/" folder.

From the root of your project run "./yii serve" on Linux/BSD/OSX or "yii.bat serve" on Windows.

Open your browser to "http://localhost:8080" and work.

@madalinignisca
madalinignisca / position-on-scroll-snippet.js
Created September 24, 2015 09:00
Get position on window scroll
/* This is a snippet found on stackoverflow: http://stackoverflow.com/questions/3714628/jquery-get-the-location-of-an-element-relative-to-window
*/
function log(txt) {
$("#log").html("location : <b>" + txt + "</b> px")
}
$(function() {
var eTop = $('#element').offset().top; //get the offset top of the element
log(eTop - $(window).scrollTop()); //position of the ele w.r.t window
@madalinignisca
madalinignisca / backupdb.sh
Created July 10, 2015 14:57
Backup the database from bash, zip it and delete any older then X days. Good to use with Cron when hosting websites.
#!/bin/bash
# replace what is in [[ ]] with necessary variables
# Database credentials
user="[[username]]"
password="[[password]]"
host="[[host]]"
db_name="[[database_name]]"
# Other options
backup_path="[[path_to_backup_folder]]"
@madalinignisca
madalinignisca / wp-config-alternate-cron.php
Last active August 29, 2015 14:24
WordPress wp-config.php extra snippets for better performance and security
<?php // Use this when you use normal web cron and scheduled posts don't get published
define( 'ALTERNATE_WP_CRON', true );