insert your style guide here, and follow it...
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 | |
input=$1 | |
query=${input// /%20} | |
url=http://api.giphy.com/v1/gifs/search\?q=$query\&api_key\=dc6zaTOxFJmzC | |
image=$(curl -s $url | jq '.data[0] | { url: .images.fixed_height.url } | .url') | |
echo "Added $image to the clipbboard." | |
echo ${image//\"/ } | pbcopy |
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 whatHasUpdated = (instance, props, state) => { | |
const changed = (obj, comparedTo) => Object.keys(obj).reduce((memo, key) => { | |
if (comparedTo[key] !== obj[key]) { | |
memo.push({ | |
key, | |
old: comparedTo[key], | |
new: obj[key], | |
}); | |
} |
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
import stringify from "json-stringify-safe"; | |
import clone from "lodash/clone"; | |
import each from "lodash/each"; | |
import find from "lodash/find"; | |
import camelCase from "lodash/camelCase"; | |
const _ = { | |
clone, each, find, camelCase, | |
}; |
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
@model IEnumerable<TechPro.Web.UI.Areas.Admin.Controllers.HomeController.RouteViewModel> | |
<div ng-app="routesModule"> | |
<h3>Routes</h3> | |
<input type="text" placeholder="Filter by Url" ng-model="query.Url" /> | |
<div ng-controller="RouteListController" ng-cloak> | |
<p>Total Routes: {{(routes | filter:query).length}}</p> |
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
public ActionResult NotFound() | |
{ | |
ActionResult result; | |
object model = Request.Url.PathAndQuery; | |
if (!Request.IsAjaxRequest()) | |
{ | |
result = View("NotFound", model); | |
} |
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
ALTER PROCEDURE [jobs].[spu_Job_List_Active_For_Recruiter] ( | |
@recruiterId INT, | |
@pageNumber INT = 1, | |
@perPage INT = 5, | |
@paging BIT = 1 | |
) AS | |
BEGIN | |
;WITH Jobs AS | |
( | |
SELECT |
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
Z7777777Z | |
777777777777777Z | |
Z7777777777777777777 | |
77777777777777777777777 | |
7777777777777777777777777D | |
7777777777777Z$777777777777N | |
7777777777D 7777777777 | |
777777777 $77777777 | |
77777777 777777777 | |
77777777 777777777 |
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
@{ | |
// Setup the tabs for the profile page. | |
// The Href will also point to a view located at `MyProfileTabs/HREF.cshtml`. | |
var tabs = new[] | |
{ | |
new | |
{ | |
Href = "tab-profile", | |
Name = "Profile", | |
ClassName = "active", |
The file I want to test is set up as an IIFE, which works great in the browser. I'm able to use the method renderInteractions
like so:
var something = utils.renderInteractions(doc);
However, when I run the test suite I get the following error:
TypeError: Object #<Object> has no method 'renderInteraction'
I found this Stack Overflow post which seems to indicate that your JavaScript file HAS to export something that Mocha can tap into: http://stackoverflow.com/questions/10204021/how-do-i-test-normal-non-node-specific-javascript-functions-with-mocha