Skip to content

Instantly share code, notes, and snippets.

View dechowdev's full-sized avatar
🚴‍♂️
Office working!

Lucas Dechow dechowdev

🚴‍♂️
Office working!
View GitHub Profile
@dechowdev
dechowdev / cn.js
Created July 20, 2021 07:53
Classname Util
const cn = (arr) =>
arr
.map((v) => {
const vals =
v &&
Object.keys(v).filter((k) => {
return v[k] && typeof v !== "string";
});
return v?.length > 0 ? v : null || (vals && vals.flat()) || v;
})

Keybase proof

I hereby claim:

  • I am dechowmedia on github.
  • I am dechowmedia (https://keybase.io/dechowmedia) on keybase.
  • I have a public key ASD1otvd08LYfq9NOlTFcBQucLJPbnzCnnRMA96mJ54t_wo

To claim this, I am signing this object:

@dechowdev
dechowdev / aliases.zsh
Last active February 9, 2017 11:59
Aliases - I use daily these...
alias glog="git log --format='%Cgreen%h%Creset %C(cyan)%an%Creset - %s' --graph"
alias s="~/Sites/"
alias glean='git branch --merged master | grep -v "\* master" | xargs -n 1 git branch -d'
alias showFiles='defaults write com.apple.finder AppleShowAllFiles YES; killall Finder /System/Library/CoreServices/Finder.app'
alias hideFiles='defaults write com.apple.finder AppleShowAllFiles NO; killall Finder /System/Library/CoreServices/Finder.app'
@dechowdev
dechowdev / homestead.md
Last active January 3, 2016 15:10
Homestead Modification

Vagrant file

require 'json'
require 'yaml'

VAGRANTFILE_API_VERSION = "2"
confDir = $confDir ||= File.expand_path("~/.homestead")

homesteadYamlPath = confDir + "/Homestead.yaml"
homesteadJsonPath = confDir + "/Homestead.json"
@dechowdev
dechowdev / commands.md
Last active January 14, 2016 20:44
Useful CLI Commands

Manipulating Images

Optimization

imagemin * thumbs (batch) imagemin filename.jpg > output_filename.jpg

Mogrify (ImageMagick)

mogrify -path thumbnail-directory -thumbnail 100x100 *

mogrify -path thumbs -resize 1280x720 -format jpg *.png

@dechowdev
dechowdev / qq.scss
Last active October 26, 2015 22:17
Quantity Queries Mixin for SASS
//While not complete this takes care of most quantity queries scenarios I have run into
/**
* Quantity Queries
* @param {[int]} $amount [Amount of elements needed for this to fire]
* @param {[type]} $q:'most' [Can have "most", "least" and "most-least"]
* @return {[@content]} [Returns the wrapped expression in a content query]
* Usage: Embed into an element of choice wrapping the properties - compile
*/
@mixin qq($amount, $max: 10, $q:'most', $elem: null){
// $elem: & !default;
if ( !class_exists('JMO_Custom_Nav')) {
class JMO_Custom_Nav {
public function add_nav_menu_meta_boxes() {
add_meta_box(
'wl_login_nav_link',
__('WishList Login'),
array( $this, 'nav_menu_link'),
'nav-menus',
'side',
'low'
@dechowdev
dechowdev / _base.scss
Last active August 29, 2015 14:03
Base to use for every web project
//BASED ON:
//BOX-SIZING BORDER-BOX FTW: http://www.paulirish.com/2012/box-sizing-border-box-ftw/
//CSS: Should we change the default for overflow?: http://bocoup.com/weblog/new-overflow-default/
* {
overflow: auto;
}
*, *:before, *:after {
@dechowdev
dechowdev / _functions-mixins.scss
Created July 2, 2014 09:11
Nice sass mixins and functions from GUFF
//MIXINS AND FUNCTIONS FROM GUFF [https://github.com/kenwheeler/guff/]
//Respect man these are dang useful!
// Strips unit suffix from value
@function _strip-unit($num) {
@if type-of($num) != "number" {
@warn "num: #{$num} is not a number";
@return null;
}
@return $num / ($num * 0 + 1);