Skip to content

Instantly share code, notes, and snippets.

@olivierlacan
olivierlacan / migrate_postgresql_database.md
Last active March 24, 2022 20:30
How to migrate a Homebrew-installed PostgreSQL database to a new major version (9.3 to 9.4) on OS X. See upgraded version of this guide: http://olivierlacan.com/posts/migrating-homebrew-postgres-to-a-new-version/

This guide assumes that you recently run brew upgrade postgresql and discovered to your dismay that you accidentally bumped from one major version to another: say 9.3.x to 9.4.x. Yes, that is a major version bump in PG land.

First let's check something.

brew info postgresql

The top of what gets printed as a result is the most important:

@webdev1001
webdev1001 / repel.js
Last active August 29, 2015 14:16 — forked from debloper/repel.js
// Set the element to select; the only moving part here
// Like literally...
var elem = document.querySelector("elem")
, html = document.querySelector("html");
// Apply positioning, just in case it wasn't already
elem.style.position = "absolute";
// Take the viewport height/width into consideration
// @TODO: should be updated on window resize
<?php
//* Add beaver-page body class
add_filter( 'body_class', 'beaver_body_class' );
function beaver_body_class( $classes ) {
$classes[] = 'beaver-page';
return $classes;
}
/* Beaver Builder Full Width Page*/
.beaver-page.fl-builder .content,
.beaver-page.fl-builder .content .page,
.beaver-page.fl-builder .content-sidebar-wrap,
.beaver-page.fl-builder .site-container,
.beaver-page.fl-builder .site-inner {
background: none;
border: 0;
float: none;
<?php
/**
* Template Name: Page Builder
*
* This page template only works with Genesis child themes and works great with the
* Beaver Builder plugin. Learn more: http://clickwp.com/blog/beaver-builder/
*/
// Force full width content layout to remove sidebar

Font Face

A mixin for writing @font-face rules in SASS.

Usage

Create a font face rule. Embedded OpenType, WOFF2, WOFF, TrueType, and SVG files are automatically sourced.

@include font-face(Samplino, fonts/Samplino);
add_action( 'wp_enqueue_scripts', 'enqueue_dev_style' );
/**
* Enqueue development css file which will be in uploads > themes > dynamik/gen root folder.
*/
function enqueue_dev_style()
{
wp_enqueue_script( 'dev', dynamik_get_stylesheet_location( 'url' ) . 'dev.js', array( 'jquery' ), CHILD_THEME_VERSION, true );
wp_enqueue_style( 'dev', dynamik_get_stylesheet_location( 'url' ) . 'dev.css', CHILD_THEME_VERSION, true );
}
# задача: приложение реализовать на Yii, а статьи публиковать в Wordpress и всё это на одном адресе и на одном порту : http://icons8.com/
# обсуждается на хабре http://habrahabr.ru/company/dataart/blog/236635/
# там же ссылки ещё на 5 примеров интеграции Wordpress и Yii
# конфиг верхнего уровня для перенаправления запросов на приложение Yii или блог wordpress
server {
listen 80;
#server_name icons8.com;
#error_log /var/log/icons8.com/error.log;
#access_log /var/log/icons8.com/access.log;
@webdev1001
webdev1001 / shame.php
Last active August 29, 2015 14:11 — forked from lmartins/shame.php
<?php
if( !defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
// Adicionar login/logout ao menu principal
// add_filter( 'wp_nav_menu_items', 'add_loginout_link', 10, 2 );
// function add_loginout_link( $items, $args ) {
// if (is_user_logged_in() && $args->theme_location == 'primary') {
// $items .= '<li><a href="'. wp_logout_url( get_permalink( woocommerce_get_page_id( 'myaccount' ) ) ) .'">Log Out</a></li>';
@webdev1001
webdev1001 / loops.php
Last active August 29, 2015 14:11 — forked from lmartins/loops.php
Change Add to Cart to Read More
add_filter( 'woocommerce_loop_add_to_cart_link', 'mw_change_add_to_cart_loop' );
function mw_change_add_to_cart_loop( $product ) {
global $product; // this may not be necessary as it should have pulled the object in already
return '<a class="button" href="' . esc_url( $product->get_permalink( $product->id ) ) . '">DETALHES</a>';
}