Skip to content

Instantly share code, notes, and snippets.

View nicocedron's full-sized avatar

José Nicolás Cedrón nicocedron

View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<title>@yield('title', 'Inicio')</title>
<link href="https://fonts.googleapis.com/css?family=Nunito:200,600,400,800" rel="stylesheet">
<link rel="stylesheet" href="{{ asset('css/app.css') }}">
@nicocedron
nicocedron / laravel_ujs.js
Created December 12, 2019 01:16
Laravel UJS
var matches = (function(doc) {
return doc.matchesSelector ||
doc.webkitMatchesSelector ||
doc.mozMatchesSelector ||
doc.oMatchesSelector ||
doc.msMatchesSelector;
})(document.documentElement);
var matchesSelfOrParent = function (element, selector) {
while (!matches.call(element, selector)) {
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<title>JQuery a JS</title>
<style>
*,*:before,*:after{
box-sizing: border-box;
margin: 0;
padding: 0;
.col-sm-6
= f.label :mobile_hero, 'Mobile Hero Image'
= image_tag explore_content.mobile_hero.url, class: 'image_preview'
= f.file_field :mobile_hero
br
#ESTO VA ANTES DEL :hero_text, 'Hero text:', c EN EL MISMO FILE
@nicocedron
nicocedron / example.scss
Created July 11, 2017 16:42
Wicked PDF Fonts to base64
@font-face {
font-family: 'Glyphicons Halflings';
src: url(asset_base64('admin/fonts/glyphicons-halflings-regular.eot'));
src: url(asset_base64('admin/fonts/glyphicons-halflings-regular.eot')) format('embedded-opentype'),
url(asset_base64('admin/fonts/glyphicons-halflings-regular.woff2')) format('woff2'),
url(asset_base64('admin/fonts/glyphicons-halflings-regular.woff')) format('woff'),
url(asset_base64('admin/fonts/glyphicons-halflings-regular.ttf')) format('truetype'),
url(asset_base64('admin/fonts/glyphicons-halflings-regular.svg')) format('svg');
}
@nicocedron
nicocedron / reset-margin-and-padding.scss
Last active November 24, 2016 00:08
Generate margin and padding reset classes
$resets: margin, padding;
$postfixes: top, bottom, left, right;
@each $reset in $resets{
.reset-#{$reset}{
#{$reset}: 0;
@each $prop in $postfixes{
&-#{$prop}{ #{$reset}-#{$prop}: 0; }
}
}
@nicocedron
nicocedron / perfect_slug.php
Last active March 4, 2016 20:14
Perfect Slug PHP
<?php
setlocale(LC_ALL, 'en_US.UTF8');
function toAscii($str, $replace=array(), $delimiter='-') {
if( !empty($replace) ) {
$str = str_replace((array)$replace, ' ', $str);
}
$clean = iconv('UTF-8', 'ASCII//TRANSLIT', $str);
$clean = preg_replace("/[^a-zA-Z0-9\/_|+ -]/", '', $clean);
@nicocedron
nicocedron / console.php
Created March 4, 2016 19:57
PHP Web Console
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Consola improvisada</title>
</head>
<body>
<?php if(isset($_POST['code'])) { ?>
Result:
@nicocedron
nicocedron / simple_template.coffee
Created November 20, 2015 15:06
Simple Template
window.templates = {}
window.SimpleTemplate = (template, data)->
if !window.templates[template]
window.templates[template] = template
return template.replace /\{([a-zA-Z0-9_\.-]*)\}/ig, (x,s)->
return eval('data.'+s)
@nicocedron
nicocedron / LocalStorageInIncognitoMode.coffee
Created May 20, 2015 18:32
Use localStorage in Incognito mode using UnderScore, jQuery Cookie.
hasStorage = ->
try
mod = new Date
localStorage.setItem mod, mod.toString()
result = localStorage.getItem(mod) == mod.toString()
localStorage.removeItem mod
return result
if !hasStorage()