Skip to content

Instantly share code, notes, and snippets.

View itzrahulsoni's full-sized avatar

Rahul itzrahulsoni

View GitHub Profile
# Hello World
This is content converted from Markdown!
Here's a JSON sample:
```json
{
"foo": "bar"
}
@itzrahulsoni
itzrahulsoni / exports.js
Created September 6, 2018 09:01
module.exports
console.log(module.filename); // /<folder path>/exports.js
console.log("Module Exports Filename = ", module.exports.filename); // undefined
console.log("Exports Filename = ", exports.filename); // undefined
console.log("Overwriting Exports");
exports = {
filename:"boo"
}
console.log("Module Exports Filename = ", module.exports.filename); // undefined
@itzrahulsoni
itzrahulsoni / azure-resource-group.sh
Last active October 9, 2017 10:58
Manage VMs of a specific Resource Group in Azure
#!/bin/bash
AZURE_RESOURCE_GROUP='YOUR_RESOURCE_GROUP_NAME'
if [ $1 == "start" ];
then
VM_NAMES=$(az vm list -g $AZURE_RESOURCE_GROUP --show-details --query "[?powerState=='VM deallocated'].{ name: name }" -o tsv)
for NAME in $VM_NAMES
do
echo "Starting $NAME"
@itzrahulsoni
itzrahulsoni / gist:3f3a06714d725720c2495543b3864264
Last active November 20, 2016 12:27
Code Injection for Ghost so that the external links open in new tab.
<script>
// By default, Ghost blogging platform opens external links in the existing tab.
// You may the change the behavior if it is not desired.
// The following code opens all external links in a new tab.
$(document).ready(function() {
// Create a regex with current location
var regex = '/' + window.location.host + '/';
regex = regex.replace(/\./g,'\\\.');
var exp = new RegExp(regex);
// Find all links