Skip to content

Instantly share code, notes, and snippets.

View PunchRockgroin's full-sized avatar

David Alberts PunchRockgroin

  • Many, many companies
  • Loveland, Colorado
View GitHub Profile
@denvers
denvers / absolute-centered-position.css
Created August 12, 2013 06:04
Absolute Centered Position (IE8+, Firefox, Chrome, etc.)
/* Within container */
.Absolute-Center {
width: 50%;
height: 50%;
overflow: auto;
margin: auto;
position: absolute;
top: 0; left: 0; bottom: 0; right: 0;
}
@chtombleson
chtombleson / silverstripe.conf
Created January 30, 2014 07:04
Silverstripe nginx config
server {
listen 80;
server_name example.com;
root /var/www/example.com;
error_log /var/log/example.com/error.log;
access_log /var/log/example.com/access.log;
location / {
try_files $uri @silverstripe;
}
<?php
function the_date_range($args) {
global $post;
$default = array(
'start_field' => 'start_date',
'end_field' => null,
'base_format' => 'Ymd',
'post_id' => $post->ID,
'separator' => '<span class="date-separator">&ndash;</span>',
'month_format' => 'F',
@retlehs
retlehs / header.php
Created April 29, 2015 04:55
Sage header template for Bootstrap top navbar component
<?php
// This file assumes that you have included the nav walker from https://github.com/twittem/wp-bootstrap-navwalker
// somewhere in your theme.
?>
<header class="banner navbar navbar-default navbar-static-top" role="banner">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only"><?= __('Toggle navigation', 'sage'); ?></span>
@raazon
raazon / add-featured-image-from-url.php
Last active December 1, 2023 18:00
How to add a featured image from a URL in WordPress
@afiqiqmal
afiqiqmal / 2019_11_03_081136_alter_all_table_id.php
Last active July 28, 2023 21:57
Migrate bigIncrements to increments with foreign key attached
<?php
/**
* Created by PhpStorm.
* User: hafiq
* Date: 03/11/2019
* Time: 11:36 PM
*/
use Illuminate\Support\Facades\Schema;
@danielstgt
danielstgt / imagick3.4.4-PHP7.4-forge.sh
Last active April 19, 2024 11:33
Install ImageMagick / Imagick 3.4.4 on PHP 7.4 server (Laravel Forge)
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
apt-get install pkg-config libmagickwand-dev -y
cd /tmp
wget https://pecl.php.net/get/imagick-3.4.4.tgz
tar xvzf imagick-3.4.4.tgz