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
var assert = require('assert'); | |
var Vue = require('vue'); | |
var TestComponent = Vue.extend({ | |
data: function() { | |
return { | |
active: false | |
}; | |
}, |
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
/** | |
* Spy on an object in a way that IE8 likes it | |
* | |
* If trying to use sinon.spy(document, 'createElement') or such in IE8, | |
* it will not work correctly. This function wraps the call in a way | |
* that it's supported in IE. | |
* | |
* May have possible side-effects to more specialized asserts,, but | |
* at least calledWith, return values, etc. * work correctly. | |
* |
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 | |
files=$(git diff --cached --name-only | grep '\.js$') | |
# Prevent ESLint help message if no files matched | |
if [[ $files = "" ]] ; then | |
exit 0 | |
fi | |
echo $files | xargs eslint |
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
var Slack = require('slack-client'); | |
var vm = require('vm'); | |
var s = new Slack('api key here', true, true); | |
s.on('message', function(msg) { | |
if(msg.type != 'message') { | |
return; | |
} |
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
GET TO THE CHOPPER nextPiece | |
HERE IS MY INVITATION currentPiece | |
GET UP forwardAmount | |
ENOUGH TALK | |
GET TO THE CHOPPER maxSize | |
HERE IS MY INVITATION track.size | |
GET DOWN 1 | |
ENOUGH TALK |
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
require 'spec_helper' | |
feature 'foo', :js => true do | |
it "hi" do | |
visit "/login" | |
# this screenshot exposes the issue in this case | |
save_screenshot('foo.jpg') | |
end | |
end |
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
var oldAddEventListener = window.addEventlistener; | |
var handlers = []; | |
window.addEventListener = function(event, handler, useCapture) { | |
handlers.push({ event: event, handler: handler }); | |
oldAddEventListener.call(window, event, handler, useCapture); | |
}; |
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
{-# LANGUAGE NoImplicitPrelude #-} | |
module Test where | |
import Language.Fay.Prelude | |
import Language.Fay.FFI | |
data Server = Server | |
{ name :: String | |
, age :: String | |
, popstate :: String |
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
{-# LANGUAGE BangPatterns #-} | |
import qualified Data.ByteString as B | |
import qualified Data.ByteString.Lazy as L | |
import Data.PEM (PEM(..), pemParseBS) | |
import Data.Certificate.X509 | |
import Data.Either | |
main :: IO () | |
main = do | |
certdata <- B.readFile "7d0b38bd.0" |
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 | |
'(java.awt Rectangle Dimension Robot Toolkit) | |
'(java.awt.image BufferedImage) | |
'(java.io File IOException) | |
'(javax.imageio ImageIO)) | |
(defn take-screenshot [] | |
(let [screen (.getScreenSize (Toolkit/getDefaultToolkit)) | |
rt (new Robot) | |
img (.createScreenCapture rt (new Rectangle (int (.getWidth screen)) (int (.getHeight screen))))] |