Skip to content

Instantly share code, notes, and snippets.

View DenisDov's full-sized avatar
🏠
Working from home

Denys Dovzhenko DenisDov

🏠
Working from home
View GitHub Profile

Revert a Git repository to a previous commit

git reset --hard [previous Commit SHA id here]
git push origin [branch Name] -f

It will remove your previous Git commit. If you want to keep your changes, you can also use:

git reset --soft [previous Commit SHA id here]
async function addImageToDOM() {
const imageDiv = document.createElement('div');
imageDiv.className = 'one-fourth';
const imgElement = document.createElement('img');
imgElement.src = generateImageLinks();
imageDiv.append(imgElement);
document.querySelector('.container').append(imageDiv);
}
@DenisDov
DenisDov / vscode_shortcuts.md
Created January 15, 2020 06:45 — forked from bradtraversy/vscode_shortcuts.md
Helpful shortcuts for VSCode

VSCode Shortcuts

List of helpful shortcuts for faster coding

If you have any other helpful shortcuts, feel free to add in the comments of this gist :)

Official List of all commands

@DenisDov
DenisDov / SQL.md
Last active November 2, 2020 12:37

Create table

CREATE TABLE Users (
	id MEDIUMINT AUTO_INCREMENT,
  email VARCHAR(50),
  password VARCHAR(50),
  PRIMARY KEY(id)
)
@DenisDov
DenisDov / mysql_cheat_sheet.md
Created December 11, 2019 09:07 — forked from bradtraversy/mysql_cheat_sheet.md
MySQL Cheat Sheet

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

@DenisDov
DenisDov / Timer.js
Created November 10, 2019 09:23 — forked from gHashTag/Timer.js
import React, { PureComponent } from 'react'
import { Text, View, StyleSheet } from 'react-native'
import moment from 'moment'
import { LIGHT_GRAY, WHITE, BLACK } from '../../styles/colors'
class Timer extends PureComponent {
state = {
remainingTime: 0,
isTimerVisible: true
}
@DenisDov
DenisDov / multiFilter.js
Created June 14, 2019 20:37 — forked from jherax/arrayFilterFactory.1.ts
Filters an array of objects with multiple criteria.
/**
* Filters an array of objects with multiple criteria.
*
* @param {Array} array: the array to filter
* @param {Object} filters: an object with the filter criteria as the property names
* @return {Array}
*/
function multiFilter(array, filters) {
const filterKeys = Object.keys(filters);
// filters all elements passing the criteria
platform :ios, '9.1'
abstract_target 'Foo' do
# RN related
pod 'React', :path => '../node_modules/react-native', :subspecs => [
'Core',
'CxxBridge',
'RCTAnimation',
'RCTBlob',
'RCTText',
@DenisDov
DenisDov / main.dart
Last active February 24, 2019 22:04
Dart fetch
import 'dart:convert';
import 'dart:html';
void main() {
_getUsersList();
}
_getUsersList() {
final url = 'https://jsonplaceholder.typicode.com/users';
Future<HttpRequest> request = HttpRequest.request(url);
//== Media queries breakpoints
//
//## Define the breakpoints at which your layout will change, adapting to different screen sizes.
// Extra small screen / phone
//** Deprecated `$screen-xs` as of v3.0.1
$screen-xs: 480px !default
//** Deprecated `$screen-xs-min` as of v3.2.0
$screen-xs-min: $screen-xs !default
//** Deprecated `$screen-phone` as of v3.0.1