Skip to content

Instantly share code, notes, and snippets.

View Mallinanga's full-sized avatar

Panos Paganis Mallinanga

  • VG web things
  • Athens, Greece
View GitHub Profile
@apisznasdin
apisznasdin / Config file for sSMTP sendmail
Created January 24, 2014 08:19
Config file for sSMTP sendmail using Mandrill
#
# Config file for sSMTP sendmail
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
root=user@domain.com
# The place where the mail goes. The actual machine name is required no
# MX records are consulted. Commonly mailhosts are named mail.domain.com
mailhub=smtp.mandrillapp.com:587
@thoop
thoop / nginx.conf
Last active December 8, 2023 21:55
Official prerender.io nginx.conf for nginx
# Change YOUR_TOKEN to your prerender token
# Change example.com (server_name) to your website url
# Change /path/to/your/root to the correct value
server {
listen 80;
server_name example.com;
root /path/to/your/root;
index index.html;
@jgable
jgable / index.js
Created September 27, 2013 19:52
Ghost Kudos Plugin Example
var fs = require('fs'),
path = require('path'),
_ = require('underscore'),
when = require('when'),
express = require('express'),
GhostPlugin = require('../../../core/server/plugins/GhostPlugin'),
knex = require('../../../core/server/models/base').Knex,
KudosPlugin;
KudosPlugin = function (ghost) {
@charleslouis
charleslouis / custom-search-acf-wordpress.php
Last active December 15, 2023 09:11
PHP - Wordpress - Search - wordpress custom search function that encompasses ACF/advanced custom fields and taxonomies and split expression before request
<?php
/**
* [list_searcheable_acf list all the custom fields we want to include in our search query]
* @return [array] [list of custom fields]
*/
function list_searcheable_acf(){
$list_searcheable_acf = array("title", "sub_title", "excerpt_short", "excerpt_long", "xyz", "myACF");
return $list_searcheable_acf;
}
@franz-josef-kaiser
franz-josef-kaiser / limit_admin_post_list_fields.php
Created July 3, 2013 13:04
Speed up the post list views in WordPress admin UI screens. Reduce the queried fields to what is needed to display the posts and what "Quick Edit" needs. Saved time increases with a higher limit set for `posts_per_screen` in the screen options drop down.
<?php
defined( 'ABSPATH' ) OR exit;
/**
* Plugin Name: (WCM) Faster Admin Post Lists
* Description: Reduces the queried fields inside WP_Query for WP_Post_List_Table screens
* Author: Franz Josef Kaiser <wecodemore@gmail.com>
* AuthorURL: http://unserkaiser.com
* License: MIT
*/
@dhrrgn
dhrrgn / parse.php
Created June 19, 2013 15:32
Parsing basic Jekyll format in PHP
<?php
// Note, you need symfony/yaml to parse the Front Matter
if ( ! Input::hasFile('file'))
{
// Do some fail here
return;
}
$contents = trim(File::get(Input::file('file')->getRealPath()));
@chrisdigital
chrisdigital / Frontend user profile in WordPress
Created May 6, 2013 13:27
Setting up a editable user profile in WordPress on the frontend.
//How to edit a user profile on the front end?
//http://wordpress.stackexchange.com/questions/9775/how-to-edit-a-user-profile-on-the-front-end
//Forcing nickname as display_name in custom edit profile template
//http://wordpress.stackexchange.com/questions/35403/forcing-nickname-as-display-name-in-custom-edit-profile-template
///////
<?php
@bonny
bonny / with-posts-wordpress-function.php
Last active May 9, 2016 18:50
WordPress function with_posts(), that simplifies getting and looping posts, in a jQuery anonymous function-ish way. Setups global, restores post afterwards. Simple, flexible and powerful.
<?php
/**
* WordPress WP_QUERY-wrapper to simplify getting and working with posts
*
* Does something with posts, using a callback
* Setups global post variable before running callback
* And restores it afterwards
*
* An introductionary blogpost about this function is posted on our blog:
@unixmonkey
unixmonkey / OSX10.8 Mountain Lion Web Developer Setup Instructions
Last active March 3, 2018 19:25
My Personal Setup Instructions from fresh OSX1.8 (Mountain Lion) install:
My Personal Setup Instructions from fresh OSX1.8 (Mountain Lion) install:
Some notes on why I have chosen some of these preferences:
I am primarlily a Ruby web developer, and work on a variety of Ruby and Rails versions and database platforms.
I usually use RVM (http://rvm.beginrescueend.com), but this guide uses [chruby](https://github.com/postmodern/chruby)
I spend most of my day in the Terminal, Atom editor, and a Web Browser, and desire to keep things as simple and stock as possible, but do have certain minor preferences that make my day-to-day interaction with the computer better.
Choose Full-Disk encryption on Install and set a password
Run software update until it cannot find any updates
@SlexAxton
SlexAxton / .zshrc
Last active April 25, 2023 03:57
My gif workflow
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else