Skip to content

Instantly share code, notes, and snippets.

@glosik
glosik / hb-snippet-variable-example.md
Created April 1, 2016 17:56 — forked from kennethormandy/hb-snippet-variable-example.md
A quick example Harp app that uses the correct title for your blog in the correct place.

A quick example Harp app that uses the correct title for your blog in the correct place.

The App

app/
  |- _harp.json
  |- _layout.ejs
  |- index.ejs
  |+ posts/
      |- _data.json
@glosik
glosik / flex
Created January 27, 2017 15:11
flex alignment quick debugging colors granular classes
<style>
.gr {background-color: rgba(0, 128, 0, 0.20);}
.rd {background-color: rgba(255, 0, 0, 0.20);}
.bl {background-color: rgba(0, 0, 255, 0.30);}
.fl {display: flex;}
.fg {flex-grow: 1;}
.fdc {flex-direction: column;}
.asc {align-self: center;}
</style>
@glosik
glosik / scroll-error-angular
Created February 22, 2017 15:24
scroll to top error jquery css
angular.element("[name='" + $scope.editProfForm.$name + "']").find('.ng-invalid:visible:first').focus();
function findFirstInvalid(form){
for(var key in form){
if(key.indexOf("$") !== 0){
if(form[key].$invalid){
return key;
}
}
}
}
currentTime = new Date();
time = currentTime.getTime();
hours = currentTime.getHours();
////////////////////////////////////
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth()+1; //January is 0!
var yyyy = today.getFullYear();
if(dd<10) {
@glosik
glosik / array-object-manipulation
Created March 16, 2017 19:52
convert array to object, add to array within object
function toObject(arr) {
var rv = {};
for (var i = 0; i < arr.length; ++i){
if (arr[i] !== undefined) {
rv[i] = arr[i];
}
}
return rv;
}
vm.filterList = toObject(data.letters);
hs.capitalizeSentence = function(string){
var words = string.split(' ');
for (i = 0; i < words.length; i++){
words[i] = words[i].charAt(0).toUpperCase()+ words[i].slice(1);
}
return words.join(' ');
};
/*
Based on:
1. http://stephen.io/mediaqueries
2. https://css-tricks.com/snippets/css/media-queries-for-standard-devices/
*/
/* iPhone 6 in portrait & landscape */
@media only screen
and (min-device-width : 375px)
and (max-device-width : 667px) {
@glosik
glosik / dom-ad-sense-error
Created May 10, 2017 14:41
ad sense error tag width fix
$(document).ready(function(){(adsbygoogle = window.adsbygoogle || []).push({})})
or
setTimeout(function(){(adsbygoogle = window.adsbygoogle || []).push({})}, 1000);