Skip to content

Instantly share code, notes, and snippets.

View jentanbernardus's full-sized avatar
:shipit:
Coding everyday keeps the doctor away!

Jentan Bernardus jentanbernardus

:shipit:
Coding everyday keeps the doctor away!
View GitHub Profile
@irazasyed
irazasyed / README.md
Last active June 24, 2017 23:13
Shell: Initial Server Setup

Simple Ubuntu Server Setup

Bash script i personally use to setup a new server initially.

Fire the following command:

wget -qO https://git.io/voICQ && sudo bash
@kanakiyajay
kanakiyajay / Gruntfile.js
Created June 13, 2015 11:17
This Gruntfile.js will clean your dist folder, concat & minify all js, css assets according config specified in html, put revisions, minify html and copy new folder structure to dist.
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
clean: ['dist'],
copy: {
generated: {
src: 'src/index.html',
dest: 'dist/index.html'
@Otto42
Otto42 / gist:b79ff5428993fcff45bb
Last active November 2, 2018 19:48
disable emojis in wp 4.2
add_action( 'init', 'disable_emoji', 1 );
function disable_emoji() {
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
remove_action( 'admin_print_styles', 'print_emoji_styles' );
remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
add_filter( 'tiny_mce_plugins', 'disable_tinymce_emoji' );
@markjaquith
markjaquith / aaa.nginxconf
Last active February 1, 2017 04:30
Grab non-locally-existing production images from Photon for your local WordPress dev environment
location ~* \.(jpe?g|gif|png)$ {
try_files $uri @photon;
}
location @photon {
rewrite ^(.*)-([0-9]+)x([0-9]+)\.(jpe?g|gif|png)$ http://i0.wp.com/$host$1.$4?resize=$2,$3;
rewrite . http://i0.wp.com/$host$request_uri;
}
@tomazzaman
tomazzaman / class-watermark-image.php
Created April 7, 2015 19:30
Watermarking uploads in WordPress with Imagemagick
function register_watermarked_size() {
add_image_size( 'watermarked', 550, 550, true ); // This is what should be uploaded
}
add_action( 'init', 'register_watermarked_size' );
class Watermark_Image {
// The attachment meta array
public $meta = array();
@barryhughes
barryhughes / sample-tribe-events.css
Created March 30, 2015 19:26
Sample tribe-events.css (examples of theming The Events Calendar views)
/**
* Sample CSS customizations for The Events Calendar and related plugins.
*
* Contents: 1. Tribe Bar Customizations
* 2. General Customizations for All Views
* 3. Month View Customizations
* 4. List View Customizations
* 5. Single Event Page Customizations
*
* Usage: This file can be used "as is" - simply save it as "tribe-events.css" within
@metinsaylan
metinsaylan / bootstrap-navbar.php
Created January 20, 2015 21:57
Bootstrap Navbar for WordPress
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<!-- Navbar Header -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#collapsible">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
@demisx
demisx / gulpfile.js
Last active July 14, 2022 16:06
Gulp 4 gulpfile.js
// Gulp 4
var gulp = require('gulp');
var using = require('gulp-using');
var grep = require('gulp-grep');
var changed = require('gulp-changed');
var del = require('del');
var coffee = require('gulp-coffee');
var less = require('gulp-less');
var coffeelint = require('gulp-coffeelint');
var sourcemaps = require('gulp-sourcemaps');
@josephscott
josephscott / build-nginx-test.sh
Last active March 28, 2016 10:47
Nginx Test Build
#!/bin/sh
NGINX_VER=1.7.7
apt-get update
apt-get -y upgrade
apt-get -y install build-essential zlib1g-dev libpcre3 libpcre3-dev libbz2-dev libssl-dev tar unzip openssl
mkdir -p dev/nginx
cd dev/nginx
curl -O http://nginx.org/download/nginx-${NGINX_VER}.tar.gz
@chrisblakley
chrisblakley / step2.php
Created October 16, 2014 02:29
Querying current weather conditions to make it rain or snow on your site.
<div id="bgimgweather">
<?php
$url = 'http://w1.weather.gov/xml/current_obs/KSYR.xml';
$xml = simplexml_load_file($url);
$currentweather = $xml->weather;
//$currentweather = "Light Rain";
?>
</div>