Skip to content

Instantly share code, notes, and snippets.

View Swizz's full-sized avatar
🍭
Little Candy

Quentin Gerodel Swizz

🍭
Little Candy
View GitHub Profile
{"openapi":"3.0.0","info":{"title":"simple-api","description":"Simplified api for external devs","version":"0.1.0"},"components":{"securitySchemes":{"auth_required":{"type":"oauth2","description":"Put this access token in the `Authorization: Bearer <token>` header","flows":{"implicit":{"authorizationUrl":"https://auth.esnah.com//realms/dev/protocol/openid-connect/auth","scopes":{"group:*":"Required for group scope"}}}}}},"servers":[{"url":"http://localhost:3000/"},{"url":"https://localhost:3000/"}],"paths":{"/organization":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","allOf":[{"type":"object","properties":{"uid":{"type":"string","format":"uuid","example":"b28ffa2c-35e9-4459-b836-606b27edec5f"},"created_at":{"type":"string","format":"date-time","description":"ISO formatted datetime (UTC, with Z at the end)","example":"2020-01-08 14:49:53.769951Z"},"updated_at":{"type":"string","format":"date-time","nullable":true,"description":"ISO formatted datetime (UTC, with Z at the
@Swizz
Swizz / milligram.grid.css
Created October 16, 2018 19:32
Only the grid of Milligram.css
*,
*:after,
*:before {
box-sizing: inherit;
}
html {
box-sizing: border-box;
}
@Swizz
Swizz / app.js
Created December 28, 2017 19:35
import { h, app } from "hyperapp"
import pupa from "pupa"
import template from "template.html"
const state = {
count: 0
}
const actions = {
@Swizz
Swizz / hoa.js
Last active October 26, 2017 08:41
HOA snippet
import { app } from "hyperapp"
function HOA(app) {
/* HOA utilities */
return function enhancer(props, container, isModule) {
/* HOA on module props too */
for (var name in props.modules) {
props.modules[name] = enhancer(props.modules[name], container, true)
}
@Swizz
Swizz / hyperapp.d.ts
Created September 22, 2017 08:15
HoF actions/events
/** @namespace [App] */
export interface State {}
export interface Thunk {
(...fn: Function[]): any | null | void
}
export type ActionResult<State extends Hyperapp.State> =
| Partial<State>
@Swizz
Swizz / Refs.js
Last active July 19, 2017 11:15
hyperapp-refs Mixin
export function Refs(app, view) {
return {
state: {
refs: {}
},
actions: {
refs: {
setRef(state, actions, { key, element }) {
return {
@Swizz
Swizz / Counter.jsx
Last active June 30, 2017 16:14
hyperapp component proposal
export default (props = { initialValue: 0, unit: '' }, children) => ({
state: {
count: props.initialValue,
unit: props.unit
},
actions: {
inc: (state, actions, data, emit) => emit('change', { count: state.count + 1 }),
dec: (state, actions, data, emit) => emit('change', { count: state.count + 1 })
@Swizz
Swizz / index.js
Created May 16, 2017 11:51
Snabbdom-pragma prepacked
(function () {
var _$0 = this;
var _$1 = Object.defineProperty;
function _0(a) {
return `REQUIRE_${a}`;
}
function _2(sel, data) {
@Swizz
Swizz / index.js
Created May 10, 2017 08:47
Date.now() challenge => JSfuck
const escape = encodeURI;
(function(){
console.log(window[[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(![]+[])[!+[]+!+[]]][([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(![]+[])[!+[]+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(![]+[])[!+[]+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(![]+[])[!+[]+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(![]+[])[!+[]+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(+[![]]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(![]+[])[!+[]+!+[]]])[+!+[]+[+!+[]]]+(!![]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!
@Swizz
Swizz / filter.js
Last active May 3, 2017 10:19 — forked from mutebg/filter.js
NaiveFP
const filter = (fn, [fst, ...rest]) =>
[fst, ...rest].length === 0 ? [] :
fn(fst) ? [fst, ...filter(fn, rest)] :
filter(fn, rest)