Skip to content

Instantly share code, notes, and snippets.

View achillar's full-sized avatar
🎯
Focusing

Antonio Chillaron achillar

🎯
Focusing
View GitHub Profile
@achillar
achillar / install-firacode.sh
Created March 22, 2023 00:18 — forked from nikhita/install-firacode.sh
How to install FiraCode font on Linux
mkdir -p ~/.local/share/fonts
for type in Bold Light Medium Regular Retina; do wget -O ~/.local/share/fonts/FiraCode-$type.ttf "https://github.com/tonsky/FiraCode/blob/master/distr/ttf/FiraCode-$type.ttf?raw=true"; done
fc-cache -f
@achillar
achillar / jquery-datepicker-failback.js
Created December 28, 2015 13:07
Using jQuery Datepicker as a failback for input type="date" fields
if (jQuery('[type="date"]').prop('type') !== 'date') {
document.write(unescape('%3Clink href="' + bcm.web_design_path + '/css/bootstrap-datepicker/datepicker3.css" rel="stylesheet" type="text/css" /%3E'));
document.write(unescape('%3Cscript src="' + bcm.web_design_path + '/js/plugins/bootstrap-datepicker/bootstrap-datepicker.js"%3E%3C/script%3E'));
document.write(unescape('%3Cscript src="' + bcm.web_design_path + '/js/plugins/bootstrap-datepicker/locales/bootstrap-datepicker.es.js"%3E%3C/script%3E'));
jQuery(document).ready(function () {
jQuery('[type="date"]').datepicker({
format: "yyyy-mm-dd",
todayBtn: true,
language: "es",
@achillar
achillar / fill_sort_cities_select.js
Created February 11, 2011 19:53
Fill a select with a catalog loaded using JSON and sorts them by name
function sort_cities(a, b) {
var compA = a.name.toUpperCase();
var compB = b.name.toUpperCase();
return (compA < compB) ? -1 : (compA > compB) ? 1 : 0;
}
jQuery( document ).ready( function( $ ) {
$.getJSON('CHANGE_ME_JSON_URL?callback=?', function(data) {
data = jQuery.makeArray(data);
data.sort(sort_cities);