This file contains 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
function which($app) { | |
foreach ($dir in $env:Path.Split(';')) { | |
$path = (Join-Path $dir $app); | |
if (Test-Path($path)) { | |
echo $path; | |
} | |
} | |
} |
This file contains 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/bash | |
# List services | Find pattern | Take 3-rd column | Pipe to `launchctl remove` | |
launchctl list | grep -iE "$1" | awk -F ' ' '{print $3}' | xargs -n1 -- launchctl remove |
This file contains 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
find . \( -type d -name node_modules \) | sort -r | sed -e 's/node_modules\/.*/node_modules/' | uniq | xargs rm -r |
This file contains 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 EOSIOHost = 'https://eos.guarda.co'; | |
class EOS { | |
/** | |
* Get EOS RAM price per byte | |
* @returns {float} RAM price | |
*/ | |
getRamPrice = async () => { | |
const { data } = await axios.post(`${EOSIOHost}/v1/chain/get_table_rows`, { |
This file contains 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
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -subj '/C=Russia/ST=Moscow/L=Moscow/O=Company/OU=Org/CN=example.com' |
This file contains 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
// In latest Visual Studio web templates we have FormsAuthentication module | |
// disabled because of OWIN autentication. Thus it is impossible to | |
// configure static file access in Web.config only. In this case we can | |
// implement custom IHttpHandler which will check access to files. | |
// Here is example of role-based access control. | |
using System.Collections.Specialized; | |
using System.Web; | |
namespace Project |