Skip to content

Instantly share code, notes, and snippets.

View gistfrojd's full-sized avatar

Fröjd Fröjdson gistfrojd

  • Fröjd Interactive
  • Stockholm
View GitHub Profile
@gistfrojd
gistfrojd / phperrors.php
Last active March 24, 2016 08:09
Show all php errors (this file has moved to https://github.com/Frojd/Manual)
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
@gistfrojd
gistfrojd / custom-wysiwyg-buttons.php
Created June 2, 2014 14:22
Wordpress - custom wysiwyg buttons
<?php
add_filter('tiny_mce_before_init', 'customize_wysiwyg_buttons');
public function customize_wysiwyg_buttons($init) {
$init['toolbar1'] = 'formatselect,styleselect,|,bold,italic,underline,|,bullist,numlist,|,link,unlink,|,removeformat';
$init['toolbar2'] = '';
$init['block_formats'] = 'Paragraph =p;Header 2 =h2;Header 3 =h3';
return $init;
@gistfrojd
gistfrojd / absolute-center.less
Created June 4, 2014 10:20
Less - Absolute center
.absoluteCenter() {
width: 50%;
height: 50%;
overflow: auto;
margin: auto;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
@gistfrojd
gistfrojd / policyfile.txt
Last active August 29, 2015 14:02
AWS - S3 Policy File
{
"Statement": [
{
"Effect": "Allow",
"Action": "s3:ListAllMyBuckets",
"Resource": "arn:aws:s3:::*"
},
{
"Effect": "Allow",
"Action": "s3:*",
@gistfrojd
gistfrojd / pagination.php
Created June 11, 2014 09:08
Wordpress - pagination
<?php
function pagination() {
// Don't print empty markup if there's only one page.
if ( $GLOBALS['wp_query']->max_num_pages < 2 ) {
return;
}
$paged = get_query_var( 'paged' ) ? intval( get_query_var( 'paged' ) ) : 1;
$pagenum_link = html_entity_decode( get_pagenum_link() );
$query_args = array();
@gistfrojd
gistfrojd / CSS Meyerweb reset
Created July 7, 2014 07:34
CSS Meyerweb reset
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
@gistfrojd
gistfrojd / README.md
Last active March 18, 2021 17:09
README.md example (this file has moved to https://github.com/Frojd/Manual)

Project name

A short introduction to your project here, what it is built in and what cms/framework etc it is using.

Requirements

This section is optional if there isn't any special dependencies. Else a bulletlist will suffice, e g:

  • Node.js
  • Mongodb
  • Amazon S3 access
@gistfrojd
gistfrojd / README-stub.md
Last active March 24, 2016 07:49
README.md project stub (this file has moved to https://github.com/Frojd/Manual)

Project name

A short introduction to your project here, what it is built in and what cms/framework etc it is using.

Requirements

This section is optional if there isn't any special dependencies. Else a bulletlist will suffice, e g:

  • Node.js
  • Mongodb
  • Amazon S3 access
@gistfrojd
gistfrojd / Preferences.sublime-settings
Last active March 24, 2016 08:14
Sublime Preferences (this file has moved to https://github.com/Frojd/Manual)
{
// Optional but good to have settings is commented out
//"word_wrap": false,
//"show_minimap": false,
//"drawWhiteSpace": true,
//"rulers":[80, 120],
// "font_options": ["gray_antialias"] // Show crisp text on retina screen
// These settings is mandatory
// Always have 4 spaces indentation
@gistfrojd
gistfrojd / jshintrc
Created August 19, 2014 09:28
jshint configuration
{
"camelcase": true,
"curly": true,
"eqeqeq": true,
"indent" : 4,
"latedef": true,
"newcap": true,
"quotmark": "double",
"undef": true,
"unused": false,