Skip to content

Instantly share code, notes, and snippets.

View Nyalab's full-sized avatar
🤢
reviewing php code

Sébastien Balayn Nyalab

🤢
reviewing php code
View GitHub Profile
@Nyalab
Nyalab / stack.js
Last active September 16, 2020 15:52
a quick react Stack component that works for styled-system components
import * as React from "react"
import Component from "components/component.js"
import Row from "components/row.js"
import View from "components/view.js"
// for now this component only works with StyledComponents as children because of `pb`
const Stack = props => {
const {children, space, direction = "vertical"} = props // TODO : implement divider prop
return (
import {useContext, useEffect, useReducer} from "react"
import FetcherContext from "~/components/fetcher.js"
import UserContext from "~/components/user.js"
const reducer = (state, action) => {
const {type, payload} = action
switch (type) {
case "SET_URL":
case "FETCH_INIT":
@Nyalab
Nyalab / settings.json
Last active March 15, 2019 10:31
VSCode Peacock Base16 Config
{
// ...
"peacock.affectActivityBar": true,
"peacock.affectStatusBar": true,
"peacock.affectTitleBar": false,
"peacock.favoriteColors": [
{"name": "Base16 Blue", "value": "#7cafc2"},
{"name": "Base16 Pink", "value": "#ba8baf"},
{"name": "Base16 Yellow", "value": "#f7ca88"},
{"name": "Base16 Red", "value": "#ab4642"},
class TresElegant extends Component {
@autobind
handleInput() { }
render() {
return <div onInput={this.handleInput}/>
}
}
class MoinsElegant extends Component {
@Nyalab
Nyalab / gist:11207136
Created April 23, 2014 08:32
domready.js
var domReadyRE = /interactive|complete|loaded/
, isReady = false
function checkStatus() {
if(isReady) return
if(domReadyRE.test(document.readyState)) {
isReady = true
ready()
return
}
@Nyalab
Nyalab / helper.php
Created April 15, 2013 12:37
Know if a partial exists in #symfony1.4
<?php
function partial_exists($templateName)
{
$context = sfContext::getInstance();
// is the partial in another module?
if (false !== $sep = strpos($templateName, '/'))
{
$moduleName = substr($templateName, 0, $sep);