Skip to content

Instantly share code, notes, and snippets.

View cameron-martin's full-sized avatar

Cameron Martin cameron-martin

View GitHub Profile
@oquenchil
oquenchil / cc_static_library.bzl
Created October 6, 2021 12:55
Example cc_static_library.bzl
"""Provides a rule that outputs a monolithic static library."""
load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain")
TOOLS_CPP_REPO = "@bazel_tools"
def _cc_static_library_impl(ctx):
output_lib = ctx.actions.declare_file("{}.a".format(ctx.attr.name))
output_flags = ctx.actions.declare_file("{}.link".format(ctx.attr.name))
@scmx
scmx / react-proptype-warnings-as-errors-with-sinon.markdown
Last active March 1, 2019 08:42
Make React PropType warnings throw errors with mocha.js, enzyme.js and sinon.js

Make React PropType warnings throw errors with enzyme.js + sinon.js + mocha.js

A simple stateless functional component that we want to test that it renders without propType warnings.

import React, { PropTypes } from 'react'

let VersionListItem = function ({ active, version }) {
  return (
var _ = require('lodash');
var gulp = require('gulp');
var browserify = require('browserify');
var watchify = require('watchify');
var transform = require('vinyl-transform');
var shimify = require('browserify-shim');
var plumber = require('gulp-plumber');
var uglify = require('gulp-uglify');
var notifier = require('node-notifier');
var util = require('gulp-util');
@sebmarkbage
sebmarkbage / Enhance.js
Last active January 31, 2024 18:33
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
@ixisio
ixisio / README.md
Last active February 27, 2018 22:58
[WEB] Automated performance regression testing
@pmhsfelix
pmhsfelix / gist:4151369
Created November 26, 2012 23:33
Generating and validating JWT tokens using JWTSecurityTokenHandler
[Fact]
public void First()
{
var tokenHandler = new JWTSecurityTokenHandler();
var symmetricKey = GetRandomBytes(256/8);
var now = DateTime.UtcNow;
var tokenDescriptor = new SecurityTokenDescriptor
{
Subject = new ClaimsIdentity(new Claim[]