Skip to content

Instantly share code, notes, and snippets.

View radibit's full-sized avatar
๐Ÿ 
Working from home

Radimir Bitsov radibit

๐Ÿ 
Working from home
View GitHub Profile
@radibit
radibit / stencil-mock-navigator-languages.js
Created November 14, 2019 14:03
Mock navigator.languages using Jest for testing Stencil components
import { SpecPage, newSpecPage } from '@stencil/core/testing';
import { VerifyNumber } from './verify-number';
const platform = require('@stencil/core/platform');
describe('verify number view', () => {
// @ts-ignore
let page: SpecPage = {
win: platform.win,
};
@radibit
radibit / fe-tech-check.md
Last active May 14, 2019 10:08
Frontend interview questions and coding tasks

Frontend Questions & Coding Tasks

A curated collection of CSS and JavaScript interview questions based on

CSS Questions

1. What is CSS selector specificity and how does it work?

The browser determines what styles to show on an element depending on the specificity of CSS rules. We assume that the browser has already determined the rules that match a particular element. Among the matching rules, the specificity, four comma-separate values, a, b, c, d are calculated for each rule based on the following:

@radibit
radibit / index.html
Last active September 12, 2017 09:24
JS Bin canvas easeInOut example source https://jsbin.com/recuzopane
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style>
canvas {
border: 1px solid #ccc;
}
@radibit
radibit / famousMathExercises.js
Created September 18, 2016 18:41
Famous Mathematical Exercises
/**
* Print fibonacci sequence
*/
let fibonacci = ( number ) => {
let result = [ 0, 1 ];
if ( number === 0 || number === 1 ) {
return result[ number ];
}
@radibit
radibit / pascalTriangle.js
Last active November 15, 2015 17:00
Pascal's Triangle
function pascalTriangle( rowsNum ) {
var prevRow, currRow;
for ( var i = 1; i < rowsNum + 1; i++ ) {
currRow = [];
for ( var d = 0; d < i; d++ ) {
currRow.push( d === 0 || d === i - 1 ? 1 : prevRow[ d - 1 ] + prevRow[ d ] );
}
@radibit
radibit / gist:07c24e0a60d18726998e
Created October 7, 2015 19:56 — forked from saetia/gist:1623487
Clean Install โ€“ OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
@radibit
radibit / solveQuadratic.js
Last active August 29, 2015 14:14
JavaScript :: Quadratic Equations solver
/**
* Create a function for calculating quadratic equations
*/
function solveQuadratic(a, b, c) {
// find the discriminant
var d = (b * b) - 4 * a * c;
// find the number of the distinct roots
// calculate the real roots
if (d === 0 && a !== 0) {
@radibit
radibit / Stan-Marsh---South-Park.markdown
Created August 14, 2014 15:00
A Pen by Radimir Bitsov.

Eric Cartman - South Park

Eric Cartman created with CSS3. This pen was inspired by Chris Pattle's 'Simpsons in CSS'

A Pen by Radimir Bitsov on CodePen.

License.