Skip to content

Instantly share code, notes, and snippets.

View rhawbert's full-sized avatar

Rhawbert Costa rhawbert

View GitHub Profile
@lopspower
lopspower / README.md
Last active May 3, 2024 13:26
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

Kirby + Patterns = <3

When I heard about Brad Frost's Patternlab for the first time at beyond tellerrand I was intrigued. The idea of splitting your design work for a website into simple modules or patterns isn't new and starts to become more and more of a standard. But organizing this into a very visual styleguide/patternlab seemed to make so much sense. Brad also introduced a very interesting approach with his separation of modules into categories, such as atoms, molecules and organisms.

I started porting Brad's patternlab app to Kirby, but it never really made it to something polished and it turned out for me after using it for Kirby's panel UI, that it's actually a pain in the ass to maintain such a pattern collection.

The problem of patternlab

The problem with such a styleguide or patternlab is that it exists next to the real thing. When you change something in your code base you also have to update the particular code for the pattern in patternlab. To be honest I went very quickly from being

@jancbeck
jancbeck / highlight.php
Created October 30, 2014 02:06
Code Highlight Plugin for Kirby CMS v2
<?php
require_once('highlight/geshi.php');
kirbytext::$pre[] = function($kirbytext, $value) {
return preg_replace_callback('!```(.*?)```!is', function($code){
$code = @$code[1];
$lines = explode("\n", $code);
@bastianallgeier
bastianallgeier / controllers--contact.php
Created October 1, 2014 19:36
Plain contactform example for Kirby 2
<?php
return function($site, $pages, $page) {
$alert = null;
if(get('submit')) {
$data = array(
'name' => get('name'),
@jonathantneal
jonathantneal / README.md
Last active March 19, 2024 23:31
Local SSL websites on macOS Sierra

Local SSL websites on macOS Sierra

These instructions will guide you through the process of setting up local, trusted websites on your own computer.

These instructions are intended to be used on macOS Sierra, but they have been known to work in El Capitan, Yosemite, Mavericks, and Mountain Lion.

NOTE: You may substitute the edit command for nano, vim, or whatever the editor of your choice is. Personally, I forward the edit command to Sublime Text:

alias edit="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"
@jacobblock
jacobblock / FreeNAS.md
Last active October 22, 2023 13:01
Ultimate FreeNAS Setup

FreeNAS

I started using FreeNAS in August 2013. It is fantastic piece of software and I have been really impressed by the upgrades just in the few months I've been using it. It looks like they recently went to a plugin system as of version 9 to make installing software easier for end users. I've ran into several issues related to plugins and user + group permissions so I decided to just use the available FreeBSD port system. After fiddling for a few days (now turned into months) I believe I have created something helpful for the community and anyone interested in picking up the port system. The sandbox nature of FreeNAS's jail system is especially helpful for playing around without having any consequence on your core system.

Here are straight-forward instructions to setting up a bunch of different software on FreeNAS. If you make a terrible error, just throw up another plugin sandbox and repeat.

ToC

@davatron5000
davatron5000 / Sublime Text Setup.md
Last active April 15, 2023 15:39
A new user's guide to SublimeText 2. Estimated reading time: 2 mins. Estimated workthrough time: 12 minutes.

Make it useful

  • Install Package Control. For SublimeText 2, paste the following in Terminal:
import urllib2,os; pf='Package Control.sublime-package'; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler( ))); open( os.path.join( ipp, pf), 'wb' ).write( urllib2.urlopen( 'http://sublime.wbond.net/' +pf.replace( ' ','%20' )).read()); print( 'Please restart Sublime Text to finish installation')

From here on out, use Package Control to install everything. +Shift+P, then type Install to get a list of installable packages you can 'livesearch through. After installing plugins, they should be running.

@cferdinandi
cferdinandi / font-face-feature-test.js
Last active September 16, 2017 10:39
A simple feature test to detect @font-face support. Include the file in your <head> element. Adds a `.font-face` class to the <html> element when `@font-face` and the `:before` psuedo selector are supported. Via Paul Irish, Diego Perini, and Mat “Wilto” Marquis.
/**
* Test for @font-face support
* @author Filament Group
* @link https://github.com/filamentgroup/face-off
* @param {Element} win
* @param {Null} undefined
* @return {Boolean}
*/
var isFontFaceSupported = (function( win, undefined ) {
@micahgodbolt
micahgodbolt / SassMeister-input.scss
Created June 24, 2013 16:08
Another stab at Filament Group's Element Query challenge.
// ---
// Sass (v3.2.9)
// ---
@mixin respond-to($queries...) {
$length: length($queries);
@for $i from 1 through $length{
@if $i % 2 == 1 {
@media screen and (min-width: nth($queries, $i)) {
@shoesforindustry
shoesforindustry / kirbycms-multifilterby.php
Last active May 17, 2020 13:23
Kirby CMS Multi Filter based on FilterBy with form selection. The idea was to be able to add fields to pages and be able to have a combined multi-filter to select pages which match *all* the filters. Select your filters and then hit the 'Filter' button: A list of selected filters will be displayed and if there are matches the pages names are dis…
<?php
#Pages have these fields, they can have comma separated values for group, category and option
# Title: Event1
# ----
# Group: Group1
# ----
# Category: Cat2
# ----
# Option: Option1