This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import MapboxGL from 'mapbox-gl'; | |
import React, { useEffect, useRef, useState, MutableRefObject } from 'react'; | |
type CoordinatesType = [number, number]; | |
interface DraggableMarkerProps { | |
coordinates: CoordinatesType; | |
map?: MapboxGL.Map; | |
children?: any; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ "root" != "$(whoami)" ]; then | |
echo "You must run this command as root" 1>&2 | |
exit 1 | |
fi | |
set -x | |
# Download and extract | |
if [ ! -z "${1}" ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin'); | |
module.exports = { | |
paths: function (paths, env) { | |
paths.appIndexJs = path.resolve(__dirname, 'src/frontend/index.js'); | |
paths.appSrc = path.resolve(__dirname, 'src/frontend'); | |
return paths; | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
choco install --yes robo3t |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var os = require('os'); | |
var ifaces = os.networkInterfaces(); | |
module.exports = () => { | |
const result = []; | |
Object.keys(ifaces).forEach(function (ifname) { | |
var alias = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n=$(which node); \ | |
n=${n%/bin/node}; \ | |
chmod -R 755 $n/bin/*; \ | |
sudo cp -r $n/{bin,lib,share} /usr/local |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# mysql -u root -p | |
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'some_very_complex_password'; | |
GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost'; | |
FLUSH PRIVILEGES; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Tabulation highlights syntax | |
set tabstop=2 | |
set shiftwidth=2 | |
set smarttab | |
set expandtab " Copy current line tabs to new line | |
set smartindent " ...like a expandtab but it adding {} tabs | |
" ========================= Short keys settings" ============================== | |
" NERDTree | |
map <silent> <C-b> :NERDTreeToggle<CR> " NERDTree toggle |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ($(document).height() > $(window).height()) { | |
$([document.documentElement, document.body]).animate({ | |
scrollTop: $("#certificate-info h2").offset().top | |
}, 2000); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class ValidationMessageDirective implements AfterViewInit, OnDestroy { | |
private validationMessageComponent: ComponentRef<ValidationMessageComponent> = null; | |
ngAfterViewInit(): void { | |
let factory = this.componentFactoryResolver.resolveComponentFactory(this.vmComp); | |
this.ngOnDestroy(); | |
this.validationMessageComponent = this.viewContainer.createComponent(factory, null, this.viewContainer.injector); | |
this.validationMessageComponent.changeDetectorRef.detectChanges(); | |
} |