Skip to content

Instantly share code, notes, and snippets.

View bitflower's full-sized avatar

Matthias Max bitflower

View GitHub Profile
@bitflower
bitflower / animate-component.tsx
Created October 28, 2019 07:32 — forked from jdnichollsc/animatable-component.html
Animatable Components using Higher Order Component (HOC) with StencilJS 🙌
import { Component, h, Element, Prop, Host, Event, EventEmitter } from '@stencil/core';
@Component({
tag: 'animatable-component'
})
export class AnimatableComponent {
@Element() el!: HTMLElement;
@Prop() keyFrames: Keyframe[]
@Prop() options: KeyframeAnimationOptions
@Event() finish: EventEmitter;
@bitflower
bitflower / .bash_profile
Created January 23, 2018 11:02 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@bitflower
bitflower / font_grabber.rb
Last active August 29, 2015 14:25 — forked from ttscoff/font_grabber.rb
Give it a <link> from Google fonts and get back CSS with fonts embedded
#!/usr/bin/ruby
# encoding: utf-8
# Grab google web fonts and embed them as base64 data URIs
# <http://brettterpstra.com/2015/03/14/embedding-google-web-fonts/>
require 'base64'
if ARGV.length > 0
input = ARGV
elsif STDIN.stat.size > 0
input = STDIN.read.strip.split(/\n+/)
@bitflower
bitflower / ng-really.js
Last active August 29, 2015 14:24 — forked from asafge/ng-really.js
/**
* A generic confirmation for risky actions.
* Usage: Add attributes: ng-really-message="Are you sure"? ng-really-click="takeAction()" function
*/
angular.module('app').directive('ngReallyClick', [function() {
return {
restrict: 'A',
link: function(scope, element, attrs) {
element.bind('click', function() {
var message = attrs.ngReallyMessage;
img
// graycity($gray, $opacity)
@include graycity(0.5, 0.7)
/* Original is in LESS and can be found here: https://gist.github.com/gefangenimnetz/3ef3e18364edf105c5af */
@mixin material-shadow($level:1){
@if $level == 1 {
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}
@else if $level == 2 {
box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
}
<?php
/**
* UserAgentDetector
*
* @author Exadra37
* @license Free to use at your own risk. Provided as it is, without any warranty that will work for you.
* @link http://presta-hosting.com
* @version 1.0.1
* @since v.1.0.0 - 09/03/2014
app.filter('trusthtml', ['$sce', function ($sce) {
return function(t) {
return $sce.trustAsHtml(t)
}
}]);
@bitflower
bitflower / classie.js
Last active August 29, 2015 14:12 — forked from desandro/classie.js
/*!
* classie - class helper functions
* from bonzo https://github.com/ded/bonzo
*
* classie.has( elem, 'my-class' ) -> true/false
* classie.add( elem, 'my-new-class' )
* classie.remove( elem, 'my-unwanted-class' )
*/
/*jshint browser: true, strict: true, undef: true */
class MAP_API_DemoItemType extends WP_JSON_CustomPostType {
protected $base = '/map/demo';
protected $type = 'demo';
public function register_routes( $routes ) {
$routes = parent::register_routes( $routes );
return $routes;
}
}