Skip to content

Instantly share code, notes, and snippets.

View incidunt's full-sized avatar

incidunt incidunt

View GitHub Profile
System process daemons that are system-wide provided by mac os x are described by launchd preference files that can be showed with the command:
$ sudo ls -all /System/Library/LaunchDaemons/
Third party process daemons that are system-wide provided by the administrator are described by preference files that can be showed with the command:
$ sudo ls -all /Library/LaunchDaemons/
Launch Agents that are per-user provided by mac os x usually loaded when the user logs in. Those provided by the system can be found with:
$ sudo ls -all /System/Library/LaunchAgents/
Launch Agents that are per-user provided by the administrator and usually loaded when the user logs in. Those provided by the system can be found with:
@incidunt
incidunt / Handler.php
Created May 16, 2019 17:33 — forked from collegeman/Handler.php
Boilerplated files for Lumen-based WordPress plugins
<?php
namespace App\Exceptions;
use Exception;
use Illuminate\Validation\ValidationException;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Laravel\Lumen\Exceptions\Handler as ExceptionHandler;
@incidunt
incidunt / functions.php
Created April 29, 2019 03:24 — forked from srikat/functions.php
Fading in last sidebar widget as it is scrolled to and making it fixed in Genesis. http://sridharkatakam.com/fade-last-sidebar-widget-scrolled-make-fixed-genesis/
add_action( 'wp_enqueue_scripts', 'enqueue_sticky_last_widget' );
function enqueue_sticky_last_widget() {
wp_enqueue_style( 'animate', get_stylesheet_directory_uri() . '/css/animate.min.css' );
wp_enqueue_script( 'waypoints', get_stylesheet_directory_uri() . '/js/waypoints.min.js', array( 'jquery' ), '1.0.0' );
wp_enqueue_script( 'waypoints-init', get_stylesheet_directory_uri() .'/js/waypoints-init.js' , array( 'jquery', 'waypoints' ), '1.0.0' );
wp_enqueue_script( 'jquery-sticky', get_stylesheet_directory_uri() .'/js/jquery.sticky.js' , array( 'jquery' ), '1.0.0' );
wp_enqueue_script( 'jquery-sticky-init', get_stylesheet_directory_uri() .'/js/jquery.sticky.init.js' , array( 'jquery-sticky' ), '1.0.0' );
@incidunt
incidunt / gist:fe1a6d9e1551cf0b668f140fe82b50d0
Created April 14, 2019 13:09 — forked from jeremyfelt/gist:2625350
Post type argument test results
'rewrite' => true
'public' => true 'publicly_queryable' => true /cpt-slug/cpt-post-slug Loads fine
'public' => false 'publicly_queryable' => true /cpt-slug/cpt-post-slug Loads fine
'public' => true 'publicly_queryable' => false /cpt-slug/cpt-post-slug 404 Error
'public' => false 'publicly_queryable' => true /cpt-slug-cpt-post-slug 404 Error
'rewrite' => false
'public' => true 'publicly_queryable' => true /?cpt-slug=cpt-post-slug Loads fine
'public' => true 'publicly_queryable' => true /?p=ID&post_type=cpt-slug Loads fine
'public' => false 'publicly_queryable' => true /?cpt-slug=cpt-post-slug Loads fine
<?php
add_action( 'wp_head', 'custom_genesis_page_builder_styles' );
/**
* Echo the necessary "Full Page Width" styles into the head of the page.
* Credit for the following CSS goes to the developer of the "Genesis Dambuster"
* Plugin as this CSS is an edited version of that Plugin's full-width.css file.
*/
function custom_genesis_page_builder_styles() {
echo '
<style type="text/css">
@incidunt
incidunt / ReadMe.md
Created March 3, 2019 09:44 — forked from patric-boehner/ReadMe.md
Single Post Navigation (Pagination)

#Customize and display links to previous and next post, from a single post


This snippet is for displaying and customizing the links to previous and next posts, for single post entries within the Genesis Framework.

Normally the links to the previous and next post are displayed in the entry footer as the title of the next and previous posts. I wanted to customize the function to swap the link order so that the newest article was accessible from the link on the left and the previous article was accessible form the link on the right, to better navigate posts in an ascending order. I also wanted to add the text "Previous Post" and "next Post" above the linked post titles for better clarification. See the comment in the code for more detail.

For additional customizable permeates, see the codex links under References.

@incidunt
incidunt / image-functions-examples.php
Created March 1, 2019 03:59 — forked from Lego2012/image-functions-examples.php
Image Functions examples #wordpress
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
<!-- 0) Display Medium sized image floated right -->
http://sridharkatakam.com/how-to-display-featured-image-in-single-posts-in-genesis/
$image_args = array(
'size' => 'medium',
'attr' => array(
@incidunt
incidunt / gruber_urlintext.py
Last active November 9, 2018 05:38 — forked from uogbuji/gruber_urlintext.py
John Gruber's regex to find URLs in plain text, converted to Python/Unicode
#See: http://daringfireball.net/2010/07/improved_regex_for_matching_urls
import re, urllib
GRUBER_URLINTEXT_PAT = re.compile(ur'(?i)\b((?:https?://|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:\'".,<>?\xab\xbb\u201c\u201d\u2018\u2019]))')
for line in urllib.urlopen("http://daringfireball.net/misc/2010/07/url-matching-regex-test-data.text"):
print [ mgroups[0] for mgroups in GRUBER_URLINTEXT_PAT.findall(line) ]
@incidunt
incidunt / filename.applescript
Created November 3, 2018 15:05 — forked from lg0/filename.applescript
applescript:get selected filename and extension
tell application "Finder" to set theFile to POSIX path of (selection as alias)
tell application "Finder" to set fileExtension to name extension of (selection as alias)
@incidunt
incidunt / gist:324537a78fd083af9de4e1493c7e8ee0
Created November 2, 2018 06:46 — forked from rentzsch/gist:1047967
Close a Chrome Tab using AppleScript
tell application "Google Chrome"
set windowList to every tab of every window whose URL starts with "https://mail.google.com"
repeat with tabList in windowList
set tabList to tabList as any
repeat with tabItr in tabList
set tabItr to tabItr as any
delete tabItr
end repeat
end repeat
end tell