Skip to content

Instantly share code, notes, and snippets.

View jCrip's full-sized avatar
🏠
Working from home

Juan Cristobal Pazos jCrip

🏠
Working from home
  • Modyo
  • Santiago, Chile
View GitHub Profile
@necolas
necolas / snippet.js
Created June 14, 2011 20:36
Optimised async loading of cross-domain scripts
/*
* Updated to use the function-based method described in http://www.phpied.com/social-button-bffs/
* Better handling of scripts without supplied ids.
*
* N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function.
*/
(function(doc, script) {
var js,
fjs = doc.getElementsByTagName(script)[0],
@innotekservices
innotekservices / jquery.spin.js
Created October 16, 2011 02:39
jQuery Plugin for Spin.js
/*
You can now create a spinner using any of the variants below:
$("#el").spin(); // Produces default Spinner using the text color of #el.
$("#el").spin("small"); // Produces a 'small' Spinner using the text color of #el.
$("#el").spin("large", "white"); // Produces a 'large' Spinner in white (or any valid CSS color).
$("#el").spin({ ... }); // Produces a Spinner using your custom settings.
$("#el").spin(false); // Kills the spinner.
@jCrip
jCrip / pubsub.js
Created March 12, 2012 16:02
jQuery: pub/sub
// PubSub
(function( $ ) {
var o = $( {} );
$.each({
trigger: 'publish',
on: 'subscribe',
off: 'unsubscribe'
}, function( key, val ) {
jQuery[val] = function() {
<?php for( $i = 0; $i < 9; $i++ ) : ?>
<p><?php echo cycle('one', 'two', 'three') ?></p>
<?php endfor; ?>
@evalica
evalica / CSScomb Alphabetical order
Created October 2, 2012 17:13
See CSScomb (http://csscomb.com/) for more details. Alphabetical order can be used by replacing $default_sort_order variable in "/Sublime Text 2/Packages/CSScomb/csscomb/libs/csscomb.php" with the following code:
$default_sort_order = '[
"-webkit-animation",
"-moz-animation",
"-ms-animation",
"-o-animation",
"animation",
"-webkit-animation-delay",
"-moz-animation-delay",
"-ms-animation-delay",
"-o-animation-delay",
@jCrip
jCrip / _retina.scss
Created January 29, 2013 16:29
Retina images mixin for SCSS
@mixin at2x($image_name, $w: auto, $h: auto, $extention: '.png') {
background-image: image-url($image_name + $extention);
$x2img : $image_name + '@2x' + $extention;
@media
all and (-webkit-min-device-pixel-ratio : 1.5),
all and (-o-min-device-pixel-ratio: 3/2),
all and (min--moz-device-pixel-ratio: 1.5),
all and (min-device-pixel-ratio: 1.5) {
background-image: image-url($x2img);
$ = jQuery
TIMEOUT = 20000
lastTime = (new Date()).getTime()
setInterval ->
currentTime = (new Date()).getTime()
# If timeout was paused (ignoring small
# variations) then trigger the 'wake' event
if currentTime > (lastTime + TIMEOUT + 2000)
@ashblue
ashblue / A-Pen-by-Ash-Blue.markdown
Created December 2, 2013 21:27
A Pen by Ash Blue.
@douglascorrea
douglascorrea / app.styl
Last active October 27, 2016 18:23
Angular Directive for Particles JS - https://github.com/VincentGarreau/particles.js
.particleJs
background-color transparent
width 35%
height 100%
display block
position absolute
top 0px
left 0px
@anschaef
anschaef / bootstrap-4-sass-mixins-cheat-sheet.scss
Last active April 12, 2024 08:49
Bootstrap 4 Sass Mixins [Cheat sheet with examples]
/* -------------------------------------------------------------------------- */
// All Bootstrap 4 Sass Mixins [Cheat sheet]
// Updated to Bootstrap v4.5.x
// @author https://anschaef.de
// @see https://github.com/twbs/bootstrap/tree/master/scss/mixins
/* -------------------------------------------------------------------------- */
/*
// ########################################################################## */
// New cheat sheet for Bootstrap 5: