Skip to content

Instantly share code, notes, and snippets.

View larodiel's full-sized avatar

Victor Larodiel larodiel

View GitHub Profile
@larodiel
larodiel / seconds-year.js
Created December 3, 2013 17:29
Get seconds of the year in javascript
function seconds_year() {
var dateObj = new Date();
var dateInit = new Date(dateObj.getFullYear(), "1", "1");
dateInit = Math.round(dateInit.getTime()/1000);
var dateCurrent = Math.round(dateObj.getTime()/1000);
return dateCurrent - dateInit;
}

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
{
"estados": [
{
"sigla": "AC",
"nome": "Acre",
"cidades": [
"Acrelândia",
"Assis Brasil",
"Brasiléia",
"Bujari",
@larodiel
larodiel / CSS Triangle LESS Mixin
Last active August 29, 2015 14:07
All CSS triangles in LESS Mixins
.css-triangle {
.css-triangle-size() {
display: inline-block;
height: 0;
width: 0;
}
.up(@size: 20px, @color: black ) {
.css-triangle-size();
border-left: @size/2 solid transparent;
@larodiel
larodiel / proportion
Created October 20, 2014 16:01
Redimension an image keeping its proportions
function prop( w ) {
var original_width = $(".content-img img").width();
var original_height = $(".content-img img").height()
if( original_width > original_height ) {
$(".content-img img").width( w );
$(".content-img img").height( (original_height *w) / original_width );
}
else {
@larodiel
larodiel / sharepoint2013-bootstrap3-reset
Last active June 8, 2020 07:55
Sharepoint 2013 bootstrap 3 reset.
/*Link reset*/
body {
a {
color: @brand-primary;
&:visited,
&:focus,
&:hover {
color: fade(@brand-primary, 10%);
text-decoration: none;
@larodiel
larodiel / .gitignore
Created August 18, 2015 15:13
gitignore to sublime text files
# cache files for sublime text
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache
# workspace files are user-specific
*.sublime-workspace
# project files should be checked into the repository, unless a significant
# proportion of contributors will probably not be using SublimeText
@larodiel
larodiel / regex.js
Last active November 6, 2015 03:42
Some helpful Regex
\#(?=[^#]*$) //get last hasn in a string
^.*\/|\.[^.]*$ //Get a basename from window.location.pathname
@larodiel
larodiel / insert.js
Created September 26, 2015 03:32
aSync javascript load.
(function () {
var s = document.createElement('script');
s.async = true;
s.type = 'text/javascript';
s.src = 'myjs.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());