Skip to content

Instantly share code, notes, and snippets.

View slowmove's full-sized avatar

Erik Hoffman slowmove

View GitHub Profile
@ekandreas
ekandreas / functions.php
Last active July 8, 2017 03:20
Block external WordPress API request
/**
* Block external WordPress API request
*/
function wp_api_block_request($pre, $args, $url)
{
if (strpos($url, 'api.wordpress.org')) {
return true;
} else {
return $pre;
}
@cartermp
cartermp / sqlclient-netcore.md
Last active November 23, 2015 16:41
Changes to SqlClient for the RC1 release

Cross-Platform SqlClient

System.Data.SqlClient is cross-platform! This means you can now take advantage of its APIs to interact with a SQL Server database across OS X, Linux, and Windows.

Windows 7 and Windows Server 2008 R2 Users

To use the library, you will need to first download and install the Visual C++ Redistributable for Visual Studio 2012 Update 4 found here.

OSX and Linux Users

@gokulkrishh
gokulkrishh / media-query.css
Last active March 18, 2025 03:44
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@jaibeee
jaibeee / brew-perms.sh
Last active January 4, 2025 01:23
Configure homebrew permissions to allow multiple users on MAC OSX. Any user from the admin group will be able to manage the homebrew and cask installation on the machine.
#!/bin/sh
# Configure homebrew permissions to allow multiple users on MAC OSX.
# Any user from the admin group will be able to manage the homebrew and cask installation on the machine.
# allow admins to manage homebrew's local install directory
chgrp -R admin /usr/local
chmod -R g+w /usr/local
# allow admins to homebrew's local cache of formulae and source files
chgrp -R admin /Library/Caches/Homebrew
@pry0cc
pry0cc / reverse-ssh.sh
Created August 5, 2015 22:10
A reverse ssh script.
mode=$1
local_ip=$2
local_port=$3
function serv_ins {
echo "ssh -N -R $local_port:localhost:22 root@$local_ip" | sudo timeout 2 nc -l -c -p $local_port
}
if [ $mode = -s ]
then
@dannguyen
dannguyen / catdrawer-youtube-to-gif-README.md
Last active September 6, 2024 12:22
Using youtube-dl and gifify from the command-line to make a cat gif
@ekandreas
ekandreas / pull.php
Created April 22, 2015 14:22
PHP Deployer - Pull script example from production to my local Bedrock/Vagrant environment
<?php
/**
* Pull script example from production to my local Bedrock/Vagrant environment
* Requires PHP Deployer 3
*
* Andreas Ek, 2015-04-23
*/
date_default_timezone_set( 'Europe/Stockholm' );
@jonkpirateboy
jonkpirateboy / chooseimagesize.php
Last active August 29, 2015 14:19
Make custom image sizes chooseable from admin
function fmd_image_sizes() {
if ( function_exists( 'add_image_size' ) ) {
add_image_size( 'bigger_thumbnail', 300, 300, true ); //will be visible in admin
add_image_size( 'carousel', 1300, 380, true ); //will not be visible in admin
}
}
add_action( 'init', 'fmd_image_sizes' );
function fmd_chooseable_image_sizes( $sizes ) {
return array_merge( $sizes, array(

How to Install Vector on Ubuntu 14

Vector is an on-host performance monitoring framework which exposes hand picked high resolution metrics to every engineer’s browser. More here.

Host machine

PCP Requirements

Vector requires PCP to collect data.

pkg-config

@cyberhiker
cyberhiker / README
Last active April 13, 2016 07:34
Cobbled Together init.d script for shairplay
This is the init.d and default file that I am using to get shairplay to run as a service.
On Ubuntu:
sudo cp "init.d - shairplay" /etc/init.d/shairplay
sudo cp "default - shairplay" /etc/default/shairplay
sudo chmod a+x /etc/init.d/shairplay
sudo update-rc.d shairplay defaults
sudo service shairplay start