Skip to content

Instantly share code, notes, and snippets.

@digitaldrummerj
digitaldrummerj / gist:727c1543ec93b0ea9bcab4c9f187d85e
Last active March 13, 2020 03:26
JS: Convert String to Upper or Lower Based on Even or Odd without using ToUpperCase/ToLowerCase
function output(str, pos) {
var result = ''
for (var i = 0; i <= str.length; i++) {
var mod = i % 2;
var code = str.charCodeAt(i);
if (pos === 'even' && mod === 0) {
result += changeChar(code);
} else if (pos === 'odd' && mod !== 0) {
result += changeChar(code);
} else {
@digitaldrummerj
digitaldrummerj / Sails-Snippets
Created November 20, 2017 00:46
Sails Snippets for Talk
{
/*
// Place your snippets for JavaScript here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
"Print to console": {
"prefix": "log",
"body": [
@digitaldrummerj
digitaldrummerj / secureUbuntuDockerSetup.md
Last active June 28, 2017 17:24
Docker ubuntu for using docker as a remote host

For Ubuntu 16.04 LTS and Docker CE 17.x

everything as sudo su

Server

Generate Certs

openssl genrsa -aes256 -out ca-key.pem 4096
@digitaldrummerj
digitaldrummerj / SassMeister-input-HTML.html
Last active October 20, 2015 22:09
Generated by SassMeister.com.
<div id="star-field">
<div class="star"></div>
<div class="star"></div>
<div class="star"></div>
<div class="star"></div>
<div class="star"></div>
<div class="star"></div>
<div class="star"></div>
<div class="star"></div>
<div class="star"></div>
@digitaldrummerj
digitaldrummerj / SassMeister-input-HTML.html
Last active October 20, 2015 20:25
Generated by SassMeister.com.
<div id="button-group">
<button class="primary">Primary</button>
<button class="secondary">Secondary</button>
<button class="secondary">Secondary</button>
</div>
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[string]$VMName,
[Parameter(Mandatory)]
[string]$OutputFile
)
function Get-DriveType($drive)
@digitaldrummerj
digitaldrummerj / gist:dfc447c0841a36735577
Created July 8, 2015 00:04
Azure Powershell SDK script to get list of VM Images available
Get-AzureVMImage | Select * | Out-Gridview –Passthru
@digitaldrummerj
digitaldrummerj / gist:be3eb227be0330867b18
Created July 8, 2015 00:02
Azure Powershell SDK Script to Get Possible VM Sizes by Location
$azurelocations = Get-AzureLocation
$out = @()
foreach ($location in $azurelocations)
{
$VMSizes = $location.VirtualMachineRoleSizes
$VMSizesStr = $VMSizes -join ', '
$props = @{
Name = $location.Name
VMSizes = $VMSizesStr}
$out += New-Object PsObject -Property $props
@digitaldrummerj
digitaldrummerj / IonicWorkshop
Last active August 29, 2015 14:19
OSx - Get All IonicWorkshop Repositories
#OSX Command
curl -s https://api.github.com/orgs/IonicWorkshop/repos?per_page=200 | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["clone_url"]} ]}'
#Windows Linqpad using Octokit.Net Nuget Package
var client = new GitHubClient(new Octokit.ProductHeaderValue("ProjectOmegatron"));
var repos = client.Repository.GetAllForOrg("IonicWorkshop").Result;
@digitaldrummerj
digitaldrummerj / 0_reuse_code.js
Last active August 29, 2015 14:18
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console