Skip to content

Instantly share code, notes, and snippets.

View takethefake's full-sized avatar
🥑

Daniel Schulz takethefake

🥑
View GitHub Profile
{
"ident": "GROUPINGDEMO",
"jsClassname": "Ic.view.protocol.ProtocolList",
"position": 1,
"active": true,
"version": "1",
"css": "icon-numbered-list",
"id": 1,
"category": {
"initializer": { },
$response = $this->triggerDoctrineEvent(
DoctrineResourceEvent::EVENT_FETCH_ALL_PRE,
$this->getEntityClass(),
$data
);
if ($response->last() instanceof ApiProblem) {
return $response->last();
}
$adapter = $queryProvider->getPaginatedQuery($queryBuilder);
{
"Mathematik für Informatiker 1": {
"V": [
{
"Monday: 09:00-10:30": {
"location": "LdV-Hs 2",
"dates": [
"2015/10/12 - Monday",
"2015/10/19 - Monday",
"2015/10/26 - Monday",
[
{
"0": {
"title": "(V): Advanced Operating Systems, Dr. H.-A. Schindler, Fak. IA"
},
"1": {
"title": "(V): Fahrdynamik 1, DI Heidrich, FG Kraftfahrzeugtechnik, Fak. MB",
"location": "Kirchhoff-Hörsaal 2",
"until": "10:30"
},
@takethefake
takethefake / Helmet.js
Created March 14, 2018 20:24
Find a Place To Get a Helmet
const fetch = require("node-fetch");
const locations = [
"Kärnten",
"Bad Kleinkirchheim",
"Heiligenblut",
"Katschberg",
"Kötschach-Mauthen",
"Mallnitz",
"Niederösterreich",
@takethefake
takethefake / react-dom-test.js
Last active October 21, 2018 16:12
Medium: Jest test with React DOM rendering
import * as React from "react";
import ReactDOM from "react-dom";
import { Input } from "../";
test("it initializes with a defaultValue", () => {
const containerDiv = document.createElement("div");
const defaultValue = "DefaultValue";
ReactDOM.render(<Input initialValue={defaultValue} />, containerDiv);
expect(containerDiv.querySelector("input").value).toBe(
defaultValue
@takethefake
takethefake / sum-test.js
Last active January 22, 2019 08:02
Medium: Simple sum test
export const sum = (x: number, y: number) => x + y;
test("it should add two numbers", () => {
// Arrange
const expected = 7;
// Act
const actual = sum(3, 4);
// Assert
@takethefake
takethefake / expect-example-vehicle.js
Last active October 21, 2018 10:59
Medium: Jest Expect example test structure
describe('Vehicle color function',()=>{
it('should return blue for car',()=>{
expect(vehicleColor('car')).toBe('blue');
});
});
@takethefake
takethefake / jest-test-structure.js
Last active October 21, 2018 10:59
Medium: Abstract test structure in Jest
// posible test
describe("what is the unit under test?", () => {
it("define a test scenario that should be tested", () => {
//write your test here
});
it("define an other test scenario that should be tested", () => {
//write your test here
});
});
@takethefake
takethefake / typescript-static-check-example.ts
Last active October 21, 2018 10:59
Medium: Typescript compilation example
function foo(x: number): string {
if (x) {
return x;
}
return "default string";
}