Skip to content

Instantly share code, notes, and snippets.

View NormySan's full-sized avatar
🦉
Hey

Christoffer Palm NormySan

🦉
Hey
View GitHub Profile
/Users/christoffer/Code/kps/backend/app/Controller/DashboardApiController.php:33:
array (size=50)
0 =>
array (size=6)
'file' => string '/Users/christoffer/Code/kps/backend/vendor/thecodingmachine/graphqlite/src/Mappers/Root/BaseTypeMapper.php' (length=106)
'line' => int 98
'function' => string 'mapClassToInputType' (length=19)
'class' => string 'TheCodingMachine\GraphQLite\Mappers\RecursiveTypeMapper' (length=55)
'type' => string '->' (length=2)
'args' =>
@NormySan
NormySan / useFilters.ts
Created February 3, 2022 09:20
A simple hook that remembers filter values and also stores them in the query string
import { useState } from 'react';
/**
* Desribes the structure of the returned value from the use filters hook.
*/
type UseFiltersTuple<T> = [T, (values: T) => void];
/**
* Gets any filters that have been set to the query/search string.
*/
@NormySan
NormySan / tutorial.md
Created July 22, 2018 10:54 — forked from swalkinshaw/tutorial.md
Designing a GraphQL API

Tutorial: Designing a GraphQL API

This tutorial was created by Shopify for internal purposes. We've created a public version of it since we think it's useful to anyone creating a GraphQL API.

It's based on lessons learned from creating and evolving production schemas at Shopify over almost 3 years. The tutorial has evolved and will continue to change in the future so nothing is set in stone.

@NormySan
NormySan / Employees.jsx
Last active May 25, 2018 17:46
React D3 Circles and Dragging
class EmpoyeesD3 extends Component {
constructor(props) {
super(props);
this.svg = React.createRef();
}
componentDidMount() {
const { height, width } = this.svg.current.getBoundingClientRect();
const radius = 165 / 2;
note: Starting in foreground mode
ok Starting native_osx for sync ess-docker-sync
success Sync container started
success Showing unison logs from your sync container: ess-docker-sync
Sync Log: [END] Copying drush
Sync Log: [BGN] Copying hero-images from /app_sync to /host_sync
Sync Log: [END] Copying hero-images
Sync Log: [BGN] Copying media from /app_sync to /host_sync
Sync Log: [END] Copying media
Sync Log: [BGN] Copying media-icons from /app_sync to /host_sync
version: '2'
syncs:
ess-docker-sync:
src: './'
sync_strategy: 'native_osx'
sync_userid: '82'
sync_excludes: ['.gitignore', '.git/', '.idea/', '.vscode/']
@NormySan
NormySan / Proposal.md
Last active October 20, 2016 13:47
Client server response structure

Proposal

This is a proposal for how to structure all responses to our cliend side code when building websites on frameworks like Angular and React.

The strucutre takes influences from specifications like the JSON API spec but simplifies it for use on the client.

The proposed structure is as follows:

{
@NormySan
NormySan / 0_reuse_code.js
Last active August 29, 2015 14:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@NormySan
NormySan / gist:9931611
Last active August 29, 2015 13:58
Angular drupal services login theory example
// Exempel 1
service:
return {
getToken: function() {
return $http.get('/rest/token', data);
},
login: function(credentials, token) {
return $http.post('/rest/user/login', credentials, {