Skip to content

Instantly share code, notes, and snippets.

View egstad's full-sized avatar

Jordan Egstad egstad

View GitHub Profile
@egstad
egstad / show-hide-hidden-files
Created June 6, 2013 13:28
Show/Hide Hidden Files in Mac OS X
#Show/Hide Hidden Files in Mac OS X
---
Copy and paste each code block into
###Show Hidden Files
```
defaults write com.apple.Finder AppleShowAllFiles TRUE
```
*Hit Return Key*
@egstad
egstad / font-sizing
Last active August 29, 2015 14:09
Font Sizing Generator
/*
* CONSTRUCT
* Font Sizing Generator
*
* BY: EGSTAD
*/
// You may use px, pt, em, and rem's. No percentages here.
$font-size: 1em;
@egstad
egstad / gist:9e463be4d4b5168caa1c
Created May 3, 2015 07:48
Reclaim ownership of .npm directory
sudo chown -R $(whoami) ~/.npm
@egstad
egstad / post-tags-in-search.php
Last active August 29, 2015 14:20
Wordpress: Include Post Tags within Search
<?php // don't include the php tag
function custom_search_where($where){
global $wpdb;
if (is_search())
$where .= "OR (t.name LIKE '%".get_search_query()."%' AND {$wpdb->posts}.post_status = 'publish')";
return $where;
}
function custom_search_join($join){
@egstad
egstad / wp-rss-hooks.md
Last active July 1, 2017 08:30
Wordpress RSS Hooks

rss2_ns - allows to add new namespaces inside the root XML element;

rss2_head - allows to add to add tags in the feed header;

the_content_feed - allows to modify the content of each Post displayed in the Feed;

rss2_item - allows to add new sub-elements to each (Post) element;

@egstad
egstad / cursor_background-change.js
Created May 11, 2015 20:37
Changing background color based on cursor position
// background color change according to cursor position
$(document).mousemove(function (e) {
var $width = ($(document).width()) / 255;
var $height = ($(document).height()) / 255;
var $pageX = parseInt(e.pageX / $width, 10);
var $pageY = parseInt(e.pageY / $height, 10);
// rgba($a-$b-$c);
var $a = $pageX,
// Viewport sizes
$vp1 : 40em;
$vp2 : 60em;
@mixin breakpoint($min:$vp1, $max:null) {
// for max-width
@if $min == max {
@media (max-width: $max) { @content; }
}
'use strict';
export const colors = {
'red': {
'dark': true,
'colors': ['d50000']
},
'redViolet': {
'dark': true,
'colors': ['c51162']
@egstad
egstad / tada68.md
Last active November 13, 2022 18:20
Update TADA68

Tada68 Remapping on Mac

Wanna remap your TADA68? Of course you do, especially if you're like me and use a Mac.


STEP 1 — Visit the editor

Click here to visit the site. This website is a piece of absolute horse shit. Enable flash and prepare yourself. View the notes section of this doc for some helpers. Once you're pleased with the layout, compile and save it into your Downloads folder. Name it FLASH.BIN (all caps).

@egstad
egstad / breaktext.js
Last active February 11, 2019 19:58
Add line break in text (Javascript Class)
class BreakText {
constructor ( element, splitAfter ) {
this.element = document.querySelector( element );
this.stringOriginal = this.element.textContent;
this.stringNew = this.stringOriginal.replace( splitAfter, `${splitAfter}\u000A` );
this.element.innerText = this.stringNew;
}
}
// How to init