Skip to content

Instantly share code, notes, and snippets.

@cron64
cron64 / CSS: Custom Radio 2.0
Last active June 25, 2018 18:29
CSS: Custom Radio 2.0
.control_radio
position relative
padding-left 30px
cursor pointer
font-size 14px
input
position absolute
z-index -1
@cron64
cron64 / CSS: Custom checkbox 2.0
Created January 31, 2018 18:47
CSS: Custom checkbox 2.0
<label class="control control--checkbox">He leído y acepto los <a href="">Términos y condiciones</a> y el <a href="">Aviso de privacidad</a>.
<input type="checkbox">
<div class="control__indicator"></div>
</label>
.control
font-size 18px
position relative
margin-bottom 15px
@cron64
cron64 / JS: First-last word selection
Created August 23, 2017 23:49
JS: First-last word selection
$(".last-word").html(function(){
var text= $(this).text().trim().split(" ");
var last = text.pop();
return text.join(" ") + (text.length > 0 ? " <span class='red'>" + last + "</span>" : last);
});
$(".first-word").html(function(){
var text= $(this).text().trim().split(" ");
var first = text.shift();
return (text.length > 0 ? "<span class='red'>"+ first + "</span> " : first) + text.join(" ");
@cron64
cron64 / Sublime: Theme scheme prefs
Created August 17, 2017 18:16
Sublime: Theme scheme prefs
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"color_scheme": "Packages/Material Theme/schemes/Material-Theme-Palenight.tmTheme",
"font_face": "Operator mono",
"font_size": 15,
"ignored_packages":
[
"Vintage"
],
@cron64
cron64 / Mac: Add space in dock
Created July 28, 2017 13:25
Mac: Add space in dock
defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}'; killall Dock
@cron64
cron64 / Iterm: subl command iterm
Created July 10, 2017 23:22
Iterm: subl command iterm
//subl command iterm sublime text 3
open /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl
ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
echo "export PATH=/usr/local/bin:$PATH" >> ~/.bash_profile
source ~/.bash_profile
@cron64
cron64 / SUBLIME: reset theme
Created July 10, 2017 20:59
SUBLIME: reset theme
view.settings().erase("color_scheme")
@cron64
cron64 / JS: Debounce Function
Created July 5, 2017 15:03
JS: Debounce Function
function debounce(func, wait = 15, immediate) {
var timeout;
return function() {
var context = this, args = arguments;
var later = function() {
timeout = null;
if (!immediate) func.apply(context, args);
};
var callNow = immediate && !timeout;
clearTimeout(timeout);
@cron64
cron64 / Modal: Modal close clicking outside
Created January 27, 2017 16:06
Modal: Modal close clicking outside
<!-- modal -->
<div class="overlay__modal">
<!-- modal container -->
<div class="modal-container">
<!-- boton cerrar -->
<a href="" class="btn--cerrar"><img src="Img/ico-close.svg" alt="Cerrar"></a>
<!-- modal info -->
<div class="modal__info">
@cron64
cron64 / Google: Map Multiple Locations v3
Created January 18, 2017 17:44
Google: Map Multiple Locations v3
<div id="map" class="map">
<script>
function initMap() {
// MAP
var locations = [
['Posición 1', -33.890542, 151.274856, 4],
['Posición 2', -33.923036, 151.259052, 5],
['Posición 3', -34.028249, 151.157507, 3],
['Posición 4', -33.80010128657071, 151.28747820854187, 2],