Skip to content

Instantly share code, notes, and snippets.

@JogoShugh
JogoShugh / gist:5650533
Created May 25, 2013 19:52
Mongoose dictionary schema and data population
mg = require 'mongoose'
dictionarySchema = mg.model('Dictionary', {
title: String,
author: String,
words: [
{ word: String, definition: String }
]
meta: {
votes: Number,
@JogoShugh
JogoShugh / profiles.json
Created June 12, 2013 17:45
Quantify list values in answers from meetup's JSON api
[ {
"mentor": true,
"profile_url": "http://www.meetup.com/CoderDojoPonceSprings/members/7498547/",
"status": "active",
"photo_url": "http://photos1.meetupstatic.com/photos/member/1/1/5/a/member_94558442.jpeg",
"answers": [
{
"answer": "Web, NodeJS, JavaScript, CoffeeScript, CSharp, DotNET, MongoDB, SQL, TwitterBootstrap, JQueryMobile, AngularJS, Backbone, Underscore, RequireJS",
"question": "If you are a professional developer/technologist interested in mentoring students on coding, what languages, technologies, platforms, etc do you specialize in?",
"question_id": 4402172
@JogoShugh
JogoShugh / AssetXml.cs
Last active December 22, 2015 15:18
VersionOne SDK.NET old school versus new school
using System;
using RestSharp;
using RestSharpToV1.VersionOne;
namespace RestSharpToV1
{
public class AssetXml
{
public static void Main(string[] args)
{
[
{
"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) {
@JogoShugh
JogoShugh / ScreenCapture.sh
Last active February 7, 2021 03:48
Screen capture and convert to Data URI from command line in windows
./MiniCapPortable/MiniCap.exe -save C:\\Users\\Josh\\cap.jpg -captureactivewin -exit
certutil -encode cap.jpg cap.txt
(lines=$(wc -l < cap.txt); tail -n +2 cap.txt | head -n $(($lines-2)) | tr -d '\n') | awk '{ print "data:image/jpg;charset=utf-8;base64,"$1 }' >data.url