Skip to content

Instantly share code, notes, and snippets.

View tegola's full-sized avatar
🏠
WFH4L

Alan Sprecacenere tegola

🏠
WFH4L
View GitHub Profile
@tegola
tegola / gist:11386f68071219e25f99
Created June 30, 2014 15:23
Bootstrap - Responsive image align left/center/right
/*
Align Bootstrap's .img-responsive images in a left, center or right aligned text container
Replaces original .img-responsive class
*/
// Responsive images (ensure images don't scale beyond their parents)
.img-responsive {
@include img-responsive();
.text-left & {
@tegola
tegola / gist:2ae7a1263cc6c31da307
Last active August 29, 2015 14:20
Cordova notification dialogs' wrapper for mixed web app/packaged app
/*
Custom wrappers for javascript's alert/confirm/prompt and their respective cordova counterparts:
https://github.com/apache/cordova-plugin-dialogs
Useful if you want to keep the same codebase on a web and a packaged app. Just keep in mind that javascript dialogs are synchronous, while cordova's are not.
Usage (for the prompt):
showPrompt("What's your name?", null, function(value){
if (value) {
console.log("Your name: "+ value);
@tegola
tegola / timeToClockFormat.js
Last active September 9, 2017 10:07
Convert a string in decimal or clock format in hh:mm format using moment.js
/**
* Convert a string in decimal or clock format in hh:mm format using moment.js
* Examples:
* 1.5 > 1:30
* 1,4 > 1:24
* 2:70 > 3:10
*
* @param string time
* @return string
*/