This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useReducer } from 'react'; | |
const useUndoReducer = (reducer, initialState) => { | |
const undoState = { | |
past: [], | |
present: initialState, | |
future: [] | |
}; | |
const undoReducer = (state, action) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var paths = [ | |
["Account"], | |
["Account", "Payment Methods"], | |
["Account", "Payment Methods", "Credit Card"], | |
["Account", "Payment Methods", "Paypal"], | |
["Account", "Emails"], | |
["Account", "Emails", "Main Email"], | |
["Account", "Emails", "Backup Email"], | |
["Account", "Devices"], | |
["Account", "Devices", "Google Pixel"], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace AdminBundle\Form; | |
use Symfony\Component\Form\AbstractType; | |
use Symfony\Component\Form\Extension\Core\Type\ChoiceType; | |
use Symfony\Component\OptionsResolver\OptionsResolver; | |
use Symfony\Component\Security\Core\Authorization\AuthorizationChecker; | |
use Symfony\Component\Security\Core\Role\Role; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module A exposing (..) | |
import Json.Decode as JD | |
import Json.Encode as JE | |
type alias User = | |
{ id : Int | |
, theme : Theme | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Models.Language exposing (..) | |
import Json.Decode exposing (int, string, decodeString, Decoder) | |
import Json.Decode.Pipeline exposing (decode, required) | |
type alias Language = | |
{ id : Int | |
, name : String | |
, label : String |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How to convert existing phoenix app to an umbrella app. | |
https://elixir-lang.slack.com/archives/phoenix/p1472921051000134 | |
chrismccord [10:14 PM] | |
@alanpeabody yes, it's straightforward | |
[10:14] | |
1) mix new my_umbrella --umbrella |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: gpl-3.0 | |
height: 960 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Symfony 2, 3, 4 color scheme - aka monolog | |
# Usage: multitail -cS symfony logfile | |
# Inspired by: https://gist.github.com/Stubbs/9504462 | |
colorscheme:symfony | |
cs_re:white,,bold:^\[....-..-.. ..:..:..\] | |
cs_re:cyan: .*\.(DEBUG): | |
cs_re:blue: .*\.(INFO|NOTICE): | |
cs_re:yellow: .*\.(WARNING): | |
cs_re:red: .*\.(ERROR|CRITICAL): | |
cs_re:red:(ERROR|CRITICAL) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Implementation in ES6 | |
function pagination(c, m) { | |
var current = c, | |
last = m, | |
delta = 2, | |
left = current - delta, | |
right = current + delta + 1, | |
range = [], | |
rangeWithDots = [], | |
l; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% macro recursiveCategory(category) %} | |
<li> | |
<h4><a href="{{ path(category.route, category.routeParams) }}">{{ category }}</a></h4> | |
{% if category.children|length %} | |
<ul> | |
{% for child in category.children %} | |
{{ _self.recursiveCategory(child) }} | |
{% endfor %} | |
</ul> |
NewerOlder