Skip to content

Instantly share code, notes, and snippets.

Panos Paganis Mallinanga

Block or report user

Report or block Mallinanga

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Mallinanga
Mallinanga / wp.php
Created Dec 8, 2013
WordPress Media Library rename files
View wp.php
<?php
if ( !defined( 'ABSPATH' ) ) {
exit;
}
add_action( 'init', 'rename_media_files_init' );
function rename_media_files_init() {
add_filter( 'attachment_fields_to_edit', 'rename_media_files_fields_to_edit', 11, 2 );
add_filter( 'attachment_fields_to_save', 'rename_media_files_attachment_fields_to_save', 11, 2 );
}
@Mallinanga
Mallinanga / maintenance.html
Last active Dec 26, 2015
Scheduled interruption of our services
View maintenance.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Scheduled interruption of our services</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="description" content="Scheduled interruption of our services"/>
<style type="text/css">
body, td{
font-size: 14px;
font-family: Arial, sans-serif;
@Mallinanga
Mallinanga / asset.html
Created Oct 13, 2013
imessage from html
View asset.html
<a href="imessage://your@appleid.com">Send iMessage to a Mac</a>
<a href="sms://your@appleid.com">Send iMessage to iOS</a>
@Mallinanga
Mallinanga / s.js
Created Jun 4, 2013
#jquery Facebook like & share counts
View s.js
(function ($) {
$.fn.fblikecount = function (options) {
var defaults = {
baseUrl: 'http://graph.facebook.com/?ids='
// Likes
// baseUrl: 'http://graph.facebook.com/
};
var options = $.extend(defaults, options);
var count = 0;
return this.each(function () {
@Mallinanga
Mallinanga / s.sh
Created Mar 31, 2013
#shell Minify images
View s.sh
#!/bin/bash
base_path=__PATH__
if type -P jpegtran &>/dev/null; then
echo 'Running jpegtran';
find $base_path -iname "*.jpg" -type f -exec jpegtran -outfile '{}' -copy none -optimize -progressive '{}' \;
else
echo 'jpegtran not found';
fi
if type -P pngcrush &>/dev/null; then
echo 'Running pngcrush';
@Mallinanga
Mallinanga / s.js
Created Mar 25, 2013
#jquery Style file inputs
View s.js
(function ($) {
$.fn.filestyle = function (options) {
var settings = {
width: 250
};
if (options) {
$.extend(settings, options);
}
return this.each(function () {
var self = this;
@Mallinanga
Mallinanga / s.css
Created Mar 15, 2013
#css WebKit scrollbar
View s.css
::-webkit-scrollbar {
width: 8px;
}
::-webkit-scrollbar:horizontal {
display: none;
}
::-webkit-scrollbar-track {
margin-top: 20px;
margin-bottom: 20px;
border-width: 21px 0;
@Mallinanga
Mallinanga / s.sql
Created Mar 14, 2013
#db Alter database/table charset/collation
View s.sql
ALTER DATABASE __databasename__ DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE __tablename__ CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
@Mallinanga
Mallinanga / s.rb
Last active Oct 12, 2015
#ruby Splendid Bacon create administrator
View s.rb
rails console
Admin.create(email: "__email__", password: "__password__", password_confirmation: "__password__")
You can’t perform that action at this time.