Skip to content

Instantly share code, notes, and snippets.

View eduardomart's full-sized avatar

Eduardo Martinez eduardomart

View GitHub Profile
@howbizarre
howbizarre / BS5RespTabs.markdown
Last active January 29, 2024 00:26
A simple way to create responsive tabs with Bootstrap 5. Tabs functionality is replaced by Accordion on small screens.

Responsive Tabs with Bootstrap 5

A simple way to create responsive tabs with Bootstrap 5. Tabs functionality is replaced by Accordion on small screens.

View sample on JsFiiddle

@zomars
zomars / boltflow-bitbucket-deploy.php
Last active April 7, 2017 16:53
Script to deploy from bitbucket via webhook and bobdenotter's Boltflow script (https://github.com/bobdenotter/boltflow)
<?php
$repo_dir = '/home/username';
$branch_to_deploy = 'master';
$update = false;
// Parse data from Bitbucket hook payload
$payload = json_decode($_POST['payload']);
if (empty($payload->commits)) {
<?php
namespace MyApp\Response;
use Symfony\Component\HttpFoundation\Response;
class CsvResponse extends Response
{
protected $data;
<?php
// This line needs to be called after initialize but before run
$app['upload'] = $app->extend(
'upload',
function ($handler, $app) {
if ($app['request']->get('contenttypeslug') && $app['request']->get('id')) {
$handler->setPrefix("/".$app['request']->get('contenttypeslug')."/".$app['request']->get('id'));
}
$app['upload'] = $app->share(
$app->extend(
'upload',
function ($upload, $app) {
$upload->setSanitizerCallback(
function ($filename) use () {
// do custom sanitising here...
}
);
var CKEDITORPluginExtras = false;
if (typeof(CKEDITOR) != 'undefined' ) {
CKEDITOR.on('instanceReady',function(event, instance){
if (CKEDITORPluginExtras) {
return;
}
var config = event.editor.config;
CKEDITOR.instances.body.destroy();
@rossriley
rossriley / gist:bb16ea1b7933292a12a4
Created April 9, 2015 12:07
How to adjust upload size by contenttype
$app->initialize();
$app['upload'] = $app->extend('upload', function ($handler, $app) {
if ($app['request']->get('contenttype') == 'pages') {
$handler->addRule('size', ['size' => '100K'], '{label} uploads are limited to {size}', 'Page Image');
}
return $handler;
});
$app->run();
@erikflowers
erikflowers / fixed-screen-layered-background.less
Last active January 31, 2019 10:48
A Less mixin for layering 2 images in a background, and using "background-cover" so the bottom layer is always full size. Good for scrolling fixed backgrounds where you want a screen or other element on top. Here's a 2x2 pixel grid to get you started: http://www.helloerik.com/downloads/grid.png.zip See an example here:
.background-layers(@top, @bottom) {
background: url(@top), url(@bottom);
background-position: top center, top center;
background-attachment: fixed, fixed;
background-repeat: repeat, repeat;
-webkit-background-size: auto, cover;
-moz-background-size: auto, cover;
-o-background-size: auto, cover;
background-size: auto, cover;
}
@lavoiesl
lavoiesl / .htaccess
Created November 21, 2012 19:37
Automatically compile LESS files
# LESS compiler
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} ^(.*)\.css
RewriteCond %1.less -f
RewriteRule ^(.*)\.css lessphp/less.php?f=$1.less
@LeVM
LeVM / Default (OSX).sublime-keymap
Created September 27, 2012 18:58
Sublime Text 2 - View in multiple broswers
{ "keys": ["alt+1"], "command": "open_browser", "args": {"keyPressed": "1"} },
{ "keys": ["alt+2"], "command": "open_browser", "args": {"keyPressed": "2"} },
{ "keys": ["alt+3"], "command": "open_browser", "args": {"keyPressed": "3"} },
{ "keys": ["alt+4"], "command": "open_browser", "args": {"keyPressed": "4"} }