Skip to content

Instantly share code, notes, and snippets.

View shubich's full-sized avatar

Andrei Shubich shubich

View GitHub Profile
@fokusferit
fokusferit / enzyme_render_diffs.md
Last active April 15, 2024 09:41
Difference between Shallow, Mount and render of Enzyme

Shallow

Real unit test (isolation, no children render)

Simple shallow

Calls:

  • constructor
  • render
@wesbos
wesbos / async-await.js
Created February 22, 2017 14:02
Simple Async/Await Example
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works
const axios = require('axios'); // promised based requests - like fetch()
function getCoffee() {
return new Promise(resolve => {
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee
});
}
@aorgish
aorgish / final-projects.md
Last active February 29, 2020 08:06
Темы финального проекта для тренинга Rolling Scopes

Темы финальных проектов

Основное требование к финальным проектам - это небольшое SPA (Single Page Application) веб-приложение с опрятным и чистым дизайном. Желательно использование фреймворков типа React или Angular. Должна быть либо серверная часть на nodejs, либо использованы сторонние API и веб-сервисы для получения данных, то есть или свой или сторонний бекенд, чтобы попрактиковать ajax-запросы. Если бекенд свой, то в идеале его можно разместить на бесплатном клауд-хостинге (https://www.heroku.com/, https://www.firebase.com, https://www.openshift.com и тд), если нужна база mongodb то можно воспользоваться бесплатным вариантом на https://mlab.com/.

Ниже примерные типовые приложения, которые можно взять за основу, если нет своих идей. Картинки даны для примера дизайна, делать похожим один в один необязательно. Дизайн типичных приложений можно подсмотреть в google images.

Calendar

![Календарь](https://kin.today/a445b830f90e9cd9c67e0c2

@zzarcon
zzarcon / fibo_loop.js
Created February 26, 2016 18:22
Fibonacci loop
function fibonacci(num){
var a = 1, b = 0, temp;
while (num >= 0){
temp = a;
a = a + b;
b = temp;
num--;
}
@nolanlawson
nolanlawson / protips.js
Last active February 4, 2024 18:06
Promise protips - stuff I wish I had known when I started with Promises
// Promise.all is good for executing many promises at once
Promise.all([
promise1,
promise2
]);
// Promise.resolve is good for wrapping synchronous code
Promise.resolve().then(function () {
if (somethingIsNotRight()) {
throw new Error("I will be rejected asynchronously!");
@jakebellacera
jakebellacera / how-to-enable-sourcemaps.md
Last active March 13, 2023 13:01
How to enable source maps for your browser.

How to enable source maps

Source mapping is a technique that "maps" your browser inspector's line numbers to the source file. This is useful when working with assets that are compiled from LESS, SASS, Coffeescript and so on. Source maps can also be used with minified assets that would normally have their line numbers removed. If you're curious, here's some more information regarding source maps.

Chrome

  1. Open Developer Tools.
    • Mac users: View > Developer > Developer Tools.
  2. Click the Settings cog icon in the upper-right corner of the Developer Tools window.
  3. Under the Sources section, check the box(es) for the source maps you want to enable.
@ocean90
ocean90 / box-shadow.html
Last active April 11, 2024 13:54
CSS3 Box Shadow, only top/right/bottom/left and all
<!DOCTYPE html>
<html>
<head>
<title>Box Shadow</title>
<style>
.box {
height: 150px;
width: 300px;
margin: 20px;