Skip to content

Instantly share code, notes, and snippets.

View incidunt's full-sized avatar

incidunt incidunt

View GitHub Profile
@cmod
cmod / hugofastsearch.md
Last active May 1, 2024 05:20 — forked from eddiewebb/readme.md
Fast, instant client side search for Hugo static site generator

Super fast, keyboard-optimized, client side Hugo search

This is a fork of and builds upon the work of Eddie Webb's search and Matthew Daly's search explorations.

It's built for the Hugo static site generator, but could be adopted to function with any json index compatible with Fuse fuzzy search library.

To see it in action, go to craigmod.com and press CMD-/ and start typing.

Fast Search

@incidunt
incidunt / browser_history.md
Created January 10, 2018 16:37 — forked from dropmeaword/browser_history.md
Playing around with Chrome's history

Browser histories

Unless you are using Safari on OSX, most browsers will have some kind of free plugin that you can use to export the browser's history. So that's probably the easiest way. The harder way, which seems to be what Safari wants is a bit more hacky but it will also work for other browsers. Turns out that most of them, including Safari, have their history saved in some kind of sqlite database file somewhere in your home directory.

The OSX Finder cheats a little bit and doesn't show us all the files that actually exist on our drive. It tries to protect us from ourselves by hiding some system and application-specific files. You can work around this by either using the terminal (my preferred method) or by using the Cmd+Shft+G in Finder.

Finder

Once you locate the file containing the browser's history, copy it to make a backup just in case we screw up.

@collegeman
collegeman / Handler.php
Last active September 5, 2022 06:59
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;
@tiann
tiann / auto_switch_kb.py
Created December 2, 2015 06:51
auto switch keyboard to english in specific applications
#! /usr/bin/env python
# coding: utf-8
'''
auto switch keyboard between different applications
if you want to change the app list, modify the var 'ignore_list'
'''
from AppKit import NSWorkspace, NSWorkspaceDidActivateApplicationNotification, NSWorkspaceApplicationKey
@dropmeaword
dropmeaword / browser_history.md
Last active April 5, 2024 17:37
Playing around with Chrome's history

Browser histories

Unless you are using Safari on OSX, most browsers will have some kind of free plugin that you can use to export the browser's history. So that's probably the easiest way. The harder way, which seems to be what Safari wants is a bit more hacky but it will also work for other browsers. Turns out that most of them, including Safari, have their history saved in some kind of sqlite database file somewhere in your home directory.

The OSX Finder cheats a little bit and doesn't show us all the files that actually exist on our drive. It tries to protect us from ourselves by hiding some system and application-specific files. You can work around this by either using the terminal (my preferred method) or by using the Cmd+Shft+G in Finder.

Finder

Once you locate the file containing the browser's history, copy it to make a backup just in case we screw up.

@marcelaraujo
marcelaraujo / gist:9a9fe07c5a4bcaea8c06
Created October 1, 2015 03:22
MacOS disable services
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:
<?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">
@ccstone
ccstone / References For Learning & Using Applescript.md
Last active February 21, 2024 05:34
References For Learning & Using Applescript

REFERENCES FOR LEARNING & USING APPLESCRIPT Modified: 2018/06/19 18:47


NOTES

AppleScript is a rather peculiar scripting language to learn.

@patric-boehner
patric-boehner / ReadMe.md
Last active March 6, 2020 04:43
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.

@andreineculau
andreineculau / sendmail.app
Last active February 2, 2018 16:41 — forked from masnick/gist:6985205
a nice way to send mail from the shell in osx
#!/usr/bin/env osascript
# usage: sendmail.app from@me.com to@you.com,and@you.com "have you seen this?" "a nice way to send mail/attachment from the shell in osx (if you have configured Mail.app) https://gist.github.com/andreineculau/38f6160cc9aa11956953"
on theSplit(theString, theDelimiter)
-- save delimiters to restore old settings
set oldDelimiters to AppleScript's text item delimiters
-- set delimiters to delimiter to be used
set AppleScript's text item delimiters to theDelimiter
-- create the array