Skip to content

Instantly share code, notes, and snippets.

View gearmobile's full-sized avatar
🇷🇺
Working remotely

Valeriy Semenenko gearmobile

🇷🇺
Working remotely
View GitHub Profile
@gearmobile
gearmobile / Calc - height by the width
Created March 9, 2016 08:50
Calc - the calculation of the height by the width
width 100%
height calc(3/4*100%)
@gearmobile
gearmobile / Color Random Function JavaScript
Created April 28, 2016 09:40
Color Random Function JavaScript
var color = 'rgb('+(Math.floor(Math.random()*256))+','+(Math.floor(Math.random()*256))+','+(Math.floor(Math.random()*256))+')';
@gearmobile
gearmobile / Hide placeholder on focus
Created May 8, 2016 13:03
Hide placeholder on focus
[placeholder]:focus::placeholder
color transparent
@gearmobile
gearmobile / SVG Icon Hover
Created July 22, 2016 08:23
SVG Icon Hover
svg
transition: all .2s
svg path
fill: inherit
@gearmobile
gearmobile / todo.md
Last active September 1, 2016 11:18 — forked from carlsednaoui/todo.md
Sample to-do list for blog post

To do

  • Post to Hacker News
  • Share HN post on Twitter

Next

  • Raise $1MM
  • Retire
@gearmobile
gearmobile / JavaScript Select DOM Elements
Created September 1, 2016 11:07
JavaScript Select DOM Elements
function $$( selector, context ) {
context = context || document;
var elements = context.querySelectorAll( selector );
return Array.prototype.slice.call( elements );
}
@gearmobile
gearmobile / Converts From Degrees To Radians
Created September 1, 2016 11:10
Converts From Degrees To Radians
Math.radians = function( degrees ) {
return degrees * Math.PI / 180;
};
@gearmobile
gearmobile / Converts From Radians To Degrees
Created September 1, 2016 11:11
Converts From Radians To Degrees
Math.degrees = function( radians ) {
return radians * 180 / Math.PI;
};
@gearmobile
gearmobile / From Celsius To Fahrenheit
Created September 1, 2016 11:13
From Celsius To Fahrenheit
function celsiusToFahrenheit( celsius ) {
return celsius * 9/5 + 32
}
@gearmobile
gearmobile / Get Random Index From Array
Created September 1, 2016 11:15
Get Random Index From Array
function ( array ) {
return Math.floor( Math.random() * array.length )
}