Skip to content

Instantly share code, notes, and snippets.

View loopmode's full-sized avatar

Jovica Aleksic loopmode

  • ETECTURE
  • Fulda, Frankfurt
View GitHub Profile
@loopmode
loopmode / macos-realpath.sh
Last active November 8, 2022 08:17
abs_path for bash
#!/bin/bash
# realpath is not available on mac os
# this might be a useful alternative
abs_path () {
echo "$(cd $(dirname "$1");pwd)/$(basename "$1")"
}
echo $(abs_path .)
@oyvindym
oyvindym / resolve-declaration-collision.md
Created April 11, 2018 06:56
How to resolve TS2717 error with declaration collision between dependencies

Resolving declaration collision between dependencies

Getting a flood of TS2717 Typescript errors when running your application?

Deleting the @types-package mentioned in the logs from the node-modules/@types folder and upgrading it again using yarn should solve the problem.

Example

@types/react-redux is complaining about subsequent property declarations (see logs below).

@darvell
darvell / add_node_exceptions.ps1
Created October 23, 2017 00:20
Adds useful exceptions to Windows Defender for node.js developers.
If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(`
[Security.Principal.WindowsBuiltInRole] "Administrator"))
{
Write-Warning "You do not have Administrator rights to run this script!`nPlease re-run this script as an Administrator!"
Break
}
Write-Host "Excluding appdata NPM folder and Node.JS install folder from Windows Defender."
Add-MpPreference -ExclusionPath ([System.Environment]::ExpandEnvironmentVariables("%APPDATA%\npm\"))
Add-MpPreference -ExclusionPath (Get-ItemProperty "HKLM:SOFTWARE\Node.js" | Select-Object -Property InstallPath)
@M1chaelTran
M1chaelTran / WebStorm.cmd
Created August 17, 2017 11:04
Add `Open with WebStorm` to Windows right click context menu
@echo off
:: change the path below to match your installed version
SET WebStormPath=C:\Program Files\JetBrains\WebStorm 2017.2.2\bin\webstorm64.exe
echo Adding file entries
@reg add "HKEY_CLASSES_ROOT\*\shell\WebStorm" /t REG_SZ /v "" /d "Open with WebStorm" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\WebStorm" /t REG_EXPAND_SZ /v "Icon" /d "%WebStormPath%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\WebStorm\command" /t REG_SZ /v "" /d "%WebStormPath% \"%%1\"" /f
@s4wny
s4wny / dell display manager command line documentation
Created October 10, 2015 18:59
dell display manager command line documentation
===============================================
Dell Display Manager
===============================================
Command language
-----------------------------------
A rich and flexible command language is supported via the
command-line, and command-line arguments can be combined.
Where appropriate, a specific display can be targeted by
prefacing the command with the display number, e.g.,
@oslego
oslego / gist:f13e136ffeaa6174289a
Last active January 3, 2019 14:24 — forked from sl4m/gist:5091803
create self-signed certificate for localhost
# SSL self signed localhost for rails start to finish, no red warnings.
# 1) Create your private key (any password will do, we remove it below)
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
@vieron
vieron / rgba2rgba+a.js
Created September 21, 2013 15:43
rgba to rgb + a
function rgbaToSVGAttrs(color) {
var regex, rgba;
color = color.replace(' ', '');
if (color.indexOf('rgba(') !== 0) {
return color;
}
regex = /(.*?)rgba\((\d+),(\d+),(\d+),([0-9]+\.[0-9]+|\d)\)/;
rgba = regex.exec(color);