Skip to content

Instantly share code, notes, and snippets.

@JogoShugh
JogoShugh / 01.js
Last active August 28, 2015 13:54
SM Presentation -- From Callbacks to Promises to Async / Await
// ES5
move(r(2), function() {
move(d(2), function() {
move(l(2), function() {
move(u(2));
});
});
});
// ES2015 refactor 1
[
{
"id": "json",
"title": "Meta JSON",
"content": "",
"mode": "json",
"url": "https:\/\/ec2-54-227-126-9.compute-1.amazonaws.com\/VersionOne\/meta.v1\/Story?accept=application\/json"
},
{
"id": "xml",
namespace VersionOne.Arena.Module.ManageBacklog
open System.Reflection
[<assembly: AssemblyVersion("1.0.0.0")>]
[<assembly: AssemblyFileVersion("1.0.0.0")>]
do()
open VersionOne.Arena.Intrastructure.Web
<?xml version="1.0" encoding="utf-16"?>
<BuildCompletionEvent2 xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<BuildUri>vstfs:///Build/Build/103</BuildUri>
<TeamFoundationServerUrl>http://tfs201064:8080/tfs/DefaultCollection</TeamFoundationServerUrl>
<Url>http://tfs201064:8080/tfs/web/build.aspx?pcguid=774086bc-c49c-4e0d-860c-98dabdf8523f&amp;builduri=vstfs:///Build/Build/103</Url>
<Title>Hello World Build Call Center_20140213.6 succeeded</Title>
<TeamProject>Hello World</TeamProject>
<AgentPath>TFS201064 - Controller</AgentPath>
<DefinitionPath>\Hello World\Call Center</DefinitionPath>
<BuildNumber>Call Center_20140213.6</BuildNumber>
@JogoShugh
JogoShugh / ver-001-hard-coded.js
Last active August 29, 2015 13:59
JavaScript guessing game
number = prompt("What's your guess?");
if (number > 29) {
alert("Too high!");
} else if (number < 29) {
alert("Too low!");
} else {
alert("Correct! The secret number is 29!");
}
# wget https://gist.githubusercontent.com/JogoShugh/a888bb58c8380a47152b/raw/allstuff.sh
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
sudo add-apt-repository ppa:webupd8team/sublime-text-3
sudo apt-get update
# Chrome
sudo apt-get install google-chrome-stable -y
# Sublime
function mongoLabResourceFactory(resourceService, resourcePath, resourceName, apiKey) {
var resource = resourceService(resourcePath + '/' + resourceName + '/:id', {
apiKey: apiKey
}, {
update: {
method: 'PUT'
}
});
resource.prototype.update = function (cb) {
$b = [System.Text.Encoding]::UTF8.GetBytes((gc script.ps1))
$script = [System.Convert]::ToBase64String($b)
$ami=Get-EC2Image -Owner self -Filters @{ Name="name"; Values="Clarity PPM Pristine Latest" } | select -expand ImageId
$resp = New-EC2Instance `
-ImageId $ami `
-MinCount 1 `
-MaxCount 1 `
-InstanceType c3.xlarge `
library(RCurl)
library(jsonlite)
#'https://www14.v1host.com/v1sdktesting/query.legacy.v1?query=' -> api
'http://54.242.130.237/VersionOne/query.legacy.v1?query=' -> api
auth <- 1L
'admin:admin' -> creds # Just another way of assigning values to variables!
# Get aroud Server-side SSL errors!
options(RCurlOptions = list(cainfo = system.file("CurlSSL", "cacert.pem", package = "RCurl")))