Skip to content

Instantly share code, notes, and snippets.

View MikeiLL's full-sized avatar

Mike iLL Kilmer MikeiLL

View GitHub Profile
@namklabs
namklabs / lorem-ipsum.sh
Last active October 31, 2018 19:22
bash lorem ipsum osx terminal
function lorem(){
# Copy lorem ipsum to your clipboard in OS X
# usage:
# $ lorem <int> <htmlflag>
# where <int> is how many paragraphs of lorem ipsum you want, each separated by 2 newlines
# and <htmlflag> is anything, indicating you want each paragraph surrounded by <p></p>. Omit if you don't want this.
@nikoskip
nikoskip / gfonts.php
Last active September 20, 2022 21:34
Demo: http://nikoskip.me/gfonts.php | You only have to use the CSS import URL that Google gives you, for instance: http://fonts.googleapis.com/css?family=Cabin:500,700,500italic,700italic
<?php
$fontTypes = array('woff2', 'woff', 'ttf', 'svg', 'eot');
$gFontURL = 'http://fonts.googleapis.com/css?family=';
$uaFonts = array(
'woff2' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36',
'woff' => 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; Trident/4.0; GTB7.4; InfoPath.3; SV1; .NET CLR 3.1.76908; WOW64; en-US)',
'ttf' => 'Mozilla/5.0 (Linux; U; Android 2.2.1; en-ca; LG-P505R Build/FRG83) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1',
'svg' => 'Mozilla/5.0(iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10',
@jpluimers
jpluimers / recursively-convert-wma-to-mp3-using-ffmeg.sh
Created April 14, 2016 21:28
Recursively convert WMA files to MP3 using ffmeg on a Mac OS X bash shell
find . -iname "*.wma" -execdir bash -c 'NAME="{}" && ffmpeg -y -i "$NAME" -ab 192k "${NAME/.wma/.mp3}" -map_metadata 0:s:0 && rm "$NAME"' \;
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@mattclements
mattclements / function.php
Last active April 16, 2024 17:04
Wordpress Disable Comments (add to function.php)
<?php
add_action('admin_init', function () {
// Redirect any user trying to access comments page
global $pagenow;
if ($pagenow === 'edit-comments.php') {
wp_redirect(admin_url());
exit;
}
@adamdehaven
adamdehaven / bgimage.css
Last active March 7, 2024 17:38
Bootstrap full-width hero section with text and image
.bgimage {
width:100%;
height:500px;
background: url('https://images.unsplash.com/photo-1438109491414-7198515b166b?q=80&fm=jpg&s=cbdabf7a79c087a0b060670a6d79726c');
background-repeat: no-repeat;
background-position: center;
background-size:cover;
background-attachment: fixed;
}
.bgimage h5 {
@anoved
anoved / acc-svg-jacker.js
Last active May 21, 2017 05:03
Get SVG from Adobe Creative Cloud asset item page
(function(){
var a = document.getElementsByClassName("item")[0];
var s = a.style.backgroundImage;
var u = s.slice(5,-2);
var u_prefix = u.substring( 0, u.indexOf(":rendition") );
var u_suffix = u.substring( u.indexOf("api_key") );
var final = u_prefix + "?" + u_suffix;
window.location = final;
})();
@brunorios1
brunorios1 / gist:dd78c1e17cd420785e8e
Last active February 8, 2017 16:49
[js] check if Modernizr is loaded, detect a feature and run code
if (typeof Modernizr == 'object') {
if (!Modernizr.touch) {
console.log('Touch device');
}
}
@tevino
tevino / fix_virtualenv
Last active March 24, 2024 09:41
Fix python virtualenv after python update
#!/usr/bin/env bash
ENV_PATH="$(dirname "$(dirname "$(which pip)")")"
SYSTEM_VIRTUALENV="$(which -a virtualenv|tail -1)"
BAD_ENV_PATHS="/usr/local"
echo "Ensure the root of the broken virtualenv:"
echo " $ENV_PATH"
@ajithrn
ajithrn / soil-nav walker.php
Last active April 20, 2017 02:31
WordPress: Soli Nav walker Modified
<?php
/*
* Modified soil nav walker to add the missing dropdown to the parent li of the ul.sub-menu
*/
namespace Roots\Soil\Nav;
use Roots\Soil\Utils;
/**