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 * as fs from "fs"; | |
const coverage = JSON.parse( | |
fs.readFileSync("coverage/coverage-final.json", "utf-8") | |
); | |
const output = Object.values(coverage).map((x) => { | |
const path = x.path; | |
const totalStatements = Object.keys(x.statementMap).length; | |
const coveredStatements = Object.entries(x.s).filter( |
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
using System.Collections.Generic; | |
using System.Linq; | |
using UnityEngine; | |
[System.Serializable] | |
public abstract class BaseReconciler<TKey, TObject> : ISerializationCallbackReceiver where TObject : Object | |
{ | |
private Dictionary<TKey, TObject> managedObjects; | |
private List<TObject> serializedManagedObjects; |
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
// importing a dependency from Cargo (the package manager) | |
extern crate threadpool; | |
use std::sync::{self, mpsc}; | |
use std::thread; | |
use std::time; | |
// data type to keep a handle for a task | |
struct ThreadpoolTask<T> { | |
rx: mpsc::Receiver<T>, |
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 nock = require('nock'); | |
const test = require('tap').test; | |
const superagent = require('superagent'); | |
test('reqheaders ignored #748 - test matching', t => { | |
nock('http://www.example.com', { | |
reqheaders: { | |
'authorization': 'Bearer TOKEN' | |
} | |
}) |
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
function render1() { | |
return ( | |
<div> | |
{ templates.length | |
? null | |
: <div>Nothing to see here, move along...</div> | |
} | |
</div> | |
); | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
</head> | |
<body> | |
<svg id="svgRoot"> | |
<g id="gElement"> | |
</g> |
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
declare module 'co' { | |
interface ICoStatic { | |
<T>(coroutine: () => IterableIterator<any>): Promise<T> | |
wrap<T>(coroutine: (...args: any[]) => IterableIterator<Promise<any>>): (...args: any[]) => Promise<T> | |
} | |
var co: ICoStatic; | |
export default co; | |
} |
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
let fs = require('fs'); | |
let path = require('path'); | |
let less = require('less'); | |
let bluebird = require('bluebird'); | |
let css = require('css'); | |
async function execute() { | |
let variablesLess = await bluebird.fromNode(cb => fs.readFile(path.join(__dirname, 'less/variables.less'), 'utf-8', cb)); | |
let [parseResult] = await bluebird.fromNode(cb => less.parse(variablesLess, cb)); | |
let varNames = parseResult.rules |
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 FloatingElement = React.createClass({ | |
propTypes: { | |
children: React.PropTypes.element.isRequired, | |
floatingClassName: React.PropTypes.string | |
}, | |
getDefaultProps() { | |
return { | |
floatingClassName: 'floating' |
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
// Paste this into the Developer Console for any project that uses jQuery | |
function stopMonkey() { | |
clearInterval(monkey); | |
} | |
monkey = setInterval(function() { | |
var $els = $('body').find('*:visible'); | |
var rand = Math.round(Math.random() * $els.length); | |
$els.eq(rand).click(); |
NewerOlder