Skip to content

Instantly share code, notes, and snippets.

View chalisegrogan's full-sized avatar

Chalise Grogan chalisegrogan

  • California
  • 21:23 (UTC -08:00)
View GitHub Profile
@chalisegrogan
chalisegrogan / SassMeister-input-HTML.html
Last active September 19, 2019 19:54
Generated by SassMeister.com.
<div class="pillar">
<div class="overview">
<div class="banner">
<h2 class="title">
Check out our new deal
</h2>
<p class="content">
100% off until 13/13/23
</p>
</div>
@chalisegrogan
chalisegrogan / jest-test-issue.md
Created June 6, 2017 17:23
JSDom issue with running Jest tests

When running tests in Jest (with the following dependencies: jest, babel-jest, react-test-renderer), kept getting the following error:

Test suite failed to run

    TypeError: require(...).evalVMScript is not a function
      
      at JSDOMEnvironment.runScript (node_modules/jest-environment-jsdom/build/index.js:56:31)
@chalisegrogan
chalisegrogan / eslint-plugin-jsx-a11y-all-rules.json
Created August 31, 2016 00:53
ESLint All eslint-plugin-jsx-a11y rules
{
"rules": {
"jsx-a11y/anchor-has-content": 1,
"jsx-a11y/aria-props": 1,
"jsx-a11y/aria-proptypes": 1,
"jsx-a11y/aria-role": 1,
"jsx-a11y/aria-unsupported-elements": 1,
"jsx-a11y/click-events-have-key-events": 1,
"jsx-a11y/heading-has-content": 1,
"jsx-a11y/href-no-hash": 1,
@chalisegrogan
chalisegrogan / example-es6-with-fetch-and-bind.js
Last active May 16, 2016 21:24
Example of React & Fetch using ES6 syntax.
/*
This is an example of how to properly call `bind` within `fetch` if referencing `this`.
*/
import React from 'react'
class ExampleWithBind extends React.Component {
constructor(props) {
super(props);
this.state = {
@chalisegrogan
chalisegrogan / DecimalDigitsInputFilter.cs
Last active August 29, 2015 14:22
Limit Decimal Places in Android EditText: Xamarin implementation of IInputFilter
/// <summary>
/// Reference: Xamarinifies http://stackoverflow.com/a/6264829/651952
/// </summary>
public class DecimalDigitsInputFilter : Java.Lang.Object, IInputFilter
{
public ICharSequence FilterFormatted(ICharSequence source, int start, int end, ISpanned dest, int dstart, int dend)
{
int dotPos = -1;
int len = dest.Length();
for (int i = 0; i < len; i++)
@chalisegrogan
chalisegrogan / brainz.aspx
Last active January 27, 2016 06:22
Example v.zero Braintree and ASP.NET Webforms implementation
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="WebForm1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Example Braintree + WebForms</title>
<script src="https://js.braintreegateway.com/v2/braintree.js"></script>
<script type="text/javascript">
$(function() {
@chalisegrogan
chalisegrogan / gist:8949807
Created February 12, 2014 03:53
Create ASP.NET Drop Down List from Enum
Public Enum MyEnum
ValueOne = 1
ValueTwo = 2
End Enum
Dim enumValues As Array = System.Enum.GetValues(GetType(MyEnum))
Dim enumNames As Array = System.Enum.GetNames(GetType(MyEnum))
For i As Integer = 0 To enumNames.Length - 1
Dim item As New ListItem(enumNames(i), enumValues(i))
if (!ModelState.IsValid)
{
var sb = new System.Text.StringBuilder();
Dictionary<string, IEnumerable<Exception>> errorList = ModelState.ToDictionary(
kvp => kvp.Key,
kvp => kvp.Value.Errors.Select(e => e.Exception)
);
sb.AppendLine("Exceptions:");