Skip to content

Instantly share code, notes, and snippets.

View misterzik's full-sized avatar
:octocat:
On the hub!

Nick misterzik

:octocat:
On the hub!
  • Nomad, somewhere called earth ...
View GitHub Profile
@salcode
salcode / .gitignore
Last active February 19, 2025 22:44
Please see https://salferrarello.com/wordpress-gitignore/ for the canonical version of this WordPress .gitignore file. Note: I do not receive notifications for comments here (because GitHub does not send notifications on Gists)
# -----------------------------------------------------------------
# .gitignore for WordPress @salcode
# ver 20180808
#
# From the root of your project run
# curl -O https://gist.githubusercontent.com/salcode/b515f520d3f8207ecd04/raw/.gitignore
# to download this file
#
# By default all files are ignored. You'll need to whitelist
# any mu-plugins, plugins, or themes you want to include in the repo.
using System;
using System.Threading.Tasks;
using Microsoft.Framework.Runtime;
using Mono.Unix;
namespace Example
{
public static class ApplicationShutdownExtensionMethods
{
public static void OnCancelKeyPress(this IApplicationShutdown applicationShutdown)
@Integralist
Integralist / docker-machine-mac-osx.md
Last active May 3, 2019 12:05
Docker Machine on Mac OS X

VirtualBox

  • https://www.docker.com/toolbox
  • docker-machine create --driver virtualbox dev
  • docker-machine env dev (add values to ~/.zshrc)
    • e.g. echo eval "$(docker-machine env dev)" >> ~/.zshrc
  • docker-machine ls
  • docker ps (might need to re-source .zshrc file; e.g. . ~/.zshrc)
  • docker run hello-world
  • docker-machine ip dev
@pradeepdotco
pradeepdotco / disable-wordpress-search.php
Created November 9, 2015 22:12
Disable WordPress Search
function fb_filter_query( $query, $error = true ) {
if ( is_search() ) {
$query->is_search = false;
$query->query_vars[s] = false;
$query->query[s] = false;
// to error
if ( $error == true )
$query->is_404 = true;
@pradeepdotco
pradeepdotco / Google-Tag-Manager-Sample-Code.php
Created February 27, 2016 11:23
Google Tag Manager Sample Code
<!-- Google Tag Manager -->
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-XXXX"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-XXXX');</script>
<!-- End Google Tag Manager -->
@pradeepdotco
pradeepdotco / Google-Tag-Manager-WordPress-Plugin-Code
Created February 28, 2016 18:16
Google Tag Manager WordPress Plugin After Body Code
<?php if ( function_exists( 'gtm4wp_the_gtm_tag' ) ) { gtm4wp_the_gtm_tag(); } ?>
@dimitardanailov
dimitardanailov / 01-controllers-to-components.md
Last active August 11, 2022 01:25
Angular 2 and Typescript. Thank you to John Papa for awesome online course: http://www.johnpapa.net/angular-2-first-look

Angular 1

<body ng-controller="StoryController as vm">
  <h3>{{ vm.story.name }}</h3>
  <h3 ng-bind="vm.story.name"></h3>
</body>
@dduvnjak
dduvnjak / add_cloudflare_ips.sh
Last active April 20, 2025 05:41
Add CloudFlare IP addresses to an EC2 Security Group using awscli
# first we download the list of IP ranges from CloudFlare
wget https://www.cloudflare.com/ips-v4
# set the security group ID
SG_ID="sg-00000000000000"
# iterate over the IP ranges in the downloaded file
# and allow access to ports 80 and 443
while read p
do
@tomysmile
tomysmile / mac-php-composer-setup.md
Created July 11, 2016 10:45
Setup PHP Composer using Brew
@benck
benck / x-editable-bs4.js
Last active January 21, 2021 08:44
A fix for x-editable to be compatible with bootstrap 4.0.0 alpha 5 and jQuery 3.1.1. Make sure you include Tether for bootstrap 4. (The button is changed to Fontawesome, you may change the $.fn.editableform.buttons to your desired buttons.)
/*! X-editable - v1.5.1
* In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery
* http://github.com/vitalets/x-editable
* Copyright (c) 2013 Vitaliy Potapov; Licensed MIT */
/**
Form with single input element, two buttons and two states: normal/loading.
Applied as jQuery method to DIV tag (not to form tag!). This is because form can be in loading state when spinner shown.
Editableform is linked with one of input types, e.g. 'text', 'select' etc.
@class editableform