Skip to content

Instantly share code, notes, and snippets.

View KarafiziArtur's full-sized avatar

Karafizi Arthur KarafiziArtur

View GitHub Profile
@KarafiziArtur
KarafiziArtur / css-resources-and-notes.md
Last active February 25, 2017 11:15
Frontend HTML & CSS resources and notes. It maybe will be updated periodically.

Good courses

@KarafiziArtur
KarafiziArtur / mobile_first.css
Created February 3, 2017 14:48
Base CSS file for "mobile first" coding
/* сброс стилей браузера */
* { box-sizing: border-box; }
html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp,small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
@KarafiziArtur
KarafiziArtur / React universal onChange handler for inputs
Created January 19, 2017 17:48
React universal onChange handler for inputs
onChangeHandler = (event) => {
this.setState({
[event.target.name]: event.target.value
});
};
const arr = [
[1,2,3,4],
[4,5,6,5],
[7,8,9,6],
[1,4,6,2]
];
const sumUpDiagonals = arr => {
let sumOfFirstDiagonal = 0;
import React from "react";
import { render } from "react-dom";
const ParentComponent = React.createClass({
getDefaultProps: function() {
console.log("ParentComponent - getDefaultProps");
},
getInitialState: function() {
console.log("ParentComponent - getInitialState");
return { text: "" };
<style>
/* ---------------------------------------------- /*
* Mouse animate icon
/* ---------------------------------------------- */
.mouse-icon {
border: 2px solid #000;
border-radius: 16px;
height: 40px;
width: 24px;
display: block;
@KarafiziArtur
KarafiziArtur / randomize-ng-repeat
Created April 14, 2016 08:55
Randomize Angular ng-repeat
<div ng-controller="MyCtrl">
<p ng-repeat="i in list|orderBy:random">{{i}}</p>
</div>
function MyCtrl($scope) {
$scope.list = ['a', 'b', 'c', 'd', 'e', 'f', 'g'];
$scope.random = function() {
return 0.5 - Math.random();
}
}
@KarafiziArtur
KarafiziArtur / git-help.md
Created April 14, 2016 07:29 — forked from luciomartinez/git-help.md
Git for humans

How to get a remote repository (from BitBucket, GitHub or anyone)

$ git clone https://github.com/<username>/<repository>.git

If you have added a SSH key, then you can also use this command:

$ git clone git@bitbucket.org:<username>/<repository>.git

How to create a new repository from the command line

// Stylus styles
.c-hamburger
display block
position relative
overflow hidden
margin 0
padding 0
width 96px
height 96px
font-size 0