Skip to content

Instantly share code, notes, and snippets.

View JustJenFelice's full-sized avatar

Jennifer Culp JustJenFelice

View GitHub Profile
@JustJenFelice
JustJenFelice / jest.config.js
Created May 26, 2021 19:01 — forked from thebuilder/jest.config.js
Use Jest Projects to run both JSDom and Node tests in the same project
module.exports = {
projects: [
{
displayName: 'dom',
testEnvironment: 'jsdom',
snapshotSerializers: ['enzyme-to-json/serializer'],
testMatch: ['**/__tests__/**/*.test.js?(x)']
},
{
displayName: 'node',
@JustJenFelice
JustJenFelice / ts-jest.md
Created January 14, 2020 05:45 — forked from jackawatts/ts-jest.md
Getting started with Typescript, React and Jest

Getting Started

  1. Install:
  • jest: npm install --save-dev jest
  • ts-jest: npm install --save-dev ts-jest @types/jest
  1. Modify package.json
    "transform": {
      "^.+\\.tsx?$": "ts-jest"
    },
@JustJenFelice
JustJenFelice / sw-test-cleaup.js
Created July 18, 2017 18:58 — forked from gauntface/sw-test-cleaup.js
Function to unregister SW and clear out old caches.
window.__testCleanup = () => {
const unregisterSW = () => {
return navigator.serviceWorker.getRegistrations()
.then((registrations) => {
const unregisterPromise = registrations.map((registration) => {
return registration.unregister();
});
return Promise.all(unregisterPromise);
});
};
@JustJenFelice
JustJenFelice / show-clicked-row-details-right-way.md
Created July 11, 2016 19:18 — forked from umidjons/show-clicked-row-details-right-way.md
Show clicked row details. Using ng-switch, ng-click, ng-class, ng-repeat, $index.

Show clicked row details. Using ng-if, ng-repeat-start and ng-repeat-end directives

<!doctype html>
<html lang="en-US" ng-app="App">
<head>
	<meta charset="UTF-8">
	<script src="angular.js"></script>
	<title>Users</title>
$base-font-size:16px;
@mixin base-10-rem($property, $values...) {
$length:length($values);
$base-value:10px;
$px-values:"";
$rem-values:"";
@for $i from 1 through $length {
$tmp:$base-value * nth($values, $i);
// Straightforward + simple.
$("button").on("click", function(event) {
event.preventDefault();
var button = $(this);
var numberElem = button.find(".number");
var number = Number(numberElem.text()) - 1;
numberElem.text(number);
if (number === 0) {
button.prop("disabled", true);
button.off("click");

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
<?php
/**
* Quickly assemled rest controller based on Kohana 3's Kohana_Controller_REST
* https://github.com/kohana/core/blob/3.1%2Fmaster/classes/kohana/controller/rest.php
*
* Added functionality from FuelPHP's Controller_Rest
* https://github.com/fuel/fuel/blob/develop/fuel/core/classes/controller/rest.php
*
* All credits to Kohana and FuelPHP teams!
* Jonas Nyström - cambiata
@JustJenFelice
JustJenFelice / util.js
Created October 22, 2012 18:02 — forked from pamelafox/util.js
JavaScript Utility Libraries (Scroll down!)
var ED = ED || {};
// Utility functions
ED.util = (function() {
// Data structure functions
function each(object, callback) {
if (object === null) return;
// call elementQuery and pass it an object containing the tests.
// also pass it an object containing a 'passed' callback and a 'failed' callback
// you can also pass a bool for whether you want to bind this to be run on resize
$('#torso').elementQuery({ 'min-width' : 910 , 'max-width' : 1155}, {
passed : function() {
$(this).addClass('l-full').removeClass('l-xlarge');
},
failed : function() {
$(this).removeClass('l-full');