Skip to content

Instantly share code, notes, and snippets.

View dsturm's full-sized avatar

Daniel Sturm dsturm

View GitHub Profile
@laurendorman
laurendorman / _cursor-mixins.scss
Last active August 8, 2019 10:49
Sass mixins + classes for cursors – For use with online photo editors, drag/drop tools, text editors and WYSIWYGs.
// Used to @include a cursor within a pre-existing class
@mixin cursor($cursor-type) {
cursor: $cursor-type;
}
// Used to generate cursor classes
@mixin cursor-class($cursor-type) {
.#{$cursor-type}-cursor { cursor: $cursor-type; }
}
@maxclaus
maxclaus / alias-docker-compose.sh
Last active August 27, 2023 15:11
Aliases for docker-compose
alias c='docker-compose'
alias cb='docker-compose build'
alias cup='docker-compose up'
alias cr='docker-compose run --service-ports --rm'
alias crl='docker-compose run --service-ports --rm local'
alias crd='docker-compose run --service-ports --rm develop'
alias crt='docker-compose run --rm test'
alias crp='docker-compose run --rm provision'
alias crci='docker-compose run --rm ci'
alias crwt='docker-compose run --rm watchtest'
@pavelthq
pavelthq / custom_view.js
Last active February 4, 2025 18:33
Visual Composer: Custom markup element example
(function($) {
window.VcCustomElementView = vc.shortcode_view.extend( {
elementTemplate: false,
$wrapper: false,
changeShortcodeParams: function ( model ) {
var params;
window.VcCustomElementView.__super__.changeShortcodeParams.call( this, model );
params = _.extend( {}, model.get( 'params' ) );
if ( ! this.elementTemplate ) {
@jalogisch
jalogisch / Netflix - Unitymedia | Customer Hell!
Last active May 15, 2016 09:45
I have since last Monday(2016-02-22) - first day i notice - problems getting Netflix Content into my home. - Lost in a Customer Hell between Netflix and Unitymedia
2016-02-22
During the Day (2016-01-22) i notice that Netflix is not working on my TV. I tried other Devices but always getting an Error pointing me to http://netflix.com/proxy.
I called netflix (Germany) and over 30 min the agent followed his script what need to be done (reboot the modem, change devices and use mobile data) to show me that netflix does not have a problem and i should call my ISP.
Short after that, i called my ISP. The Agent told me that this morning they got notified by the tech department that unitymedia tech is working with netflix tech on this issue.
If i use another connection - a VPN to my Server, mobile data - connection is possible. Netflix relax and say "look your ISP has an issue"
Detailed Information are written down as note to my Account.

#Laravel Valet HTTPS

Prior to Valet 1.1 you could user HAproxy After the introduction of Caddy server in Valet 1.1 you can add a simple file. (Recommend still generating a certificate to use for now).

Assuming we are using .dev domain.

#Valet 1.1+

Build a certificate (see next section)

@aaemnnosttv
aaemnnosttv / mamp-to-valet.md
Last active March 1, 2023 14:40
MAMP to Valet

MAMP to Valet

One-time Dependency Setup/Configuration

Install Composer

wget https://getcomposer.org/download/1.1.0/composer.phar && chmod +x composer.phar && sudo mv /usr/local/bin/composer && composer self-update
@joshmoto
joshmoto / _forms.scss
Last active September 21, 2017 12:46
Gravity Forms SASS overides inconjunction with Jay Hoffmann's `add_bootstrap_container_class` php function.
/**
* @description Gravity Forms SASS overides inconjunction with Jay Hoffmann's add_bootstrap_container_class
*
* @author Jay Hoffmann (modified by Josh Cranwell)
*
* @source https://jayhoffmann.com/using-gravity-forms-bootstrap-styles/
*
* @instructions
* - Gravity Form settings: HTML 5 [true], CSS OUTPUT [false].
* - Repsonsive column classes must be added to each field in the admin to control inputs .col-[screen-size]-[column-count]
@kurtextrem
kurtextrem / index.js
Created July 30, 2016 06:22
Throttle Function
function on_resize(namespace, callback, t) {
$(window).on('resize.' + namespace, function () {
clearTimeout(t);
t = setTimeout(callback, 100);
});
return callback;
}
@glueckpress
glueckpress / wp-rocket-cpt-clean-posts-cache-example.php
Last active April 8, 2022 19:49
[WordPress][WP Rocket]Clear the cache only for certain pages when a new post of a certain custom post type is published, deleted or changed
<?php
/**
* UNTESTED EXAMPLE!
* Please don’t use in production without having tested it before!
* @param integer $post_id Current post ID
* @return integer Current post ID
*/
function example__cpt_clean_posts_cache( $post_id ) {
$post = get_post( $post_id );
@lukechilds
lukechilds / get_latest_release.sh
Created August 9, 2016 19:43
Shell - Get latest release from GitHub
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}
# Usage
# $ get_latest_release "creationix/nvm"
# v0.31.4