Skip to content

Instantly share code, notes, and snippets.

View Baldrani's full-sized avatar
💢
C T 😮 (Carlos) G 😮 (hs) N E

Maël Mayon Baldrani

💢
C T 😮 (Carlos) G 😮 (hs) N E
View GitHub Profile
import React from "react";
import { CSSTransition } from "react-transition-group";
import ModalPortal from "../ModalPortal";
export function useModal() {
const [isModalVisible, setIsModalVisitble] = React.useState(false);
const toggleModal = () => {
setIsModalVisitble((prevState) => !prevState);
};
const closeModal = () => {
// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
javascript: (function() {
var domStyle = document.createElement("style");
domStyle.append(
'* { color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }\
* * { background-color: rgba(0,255,0,.2) !important; }\
* * * { background-color: rgba(0,0,255,.2) !important; }\
* * * * { background-color: rgba(255,0,255,.2) !important; }\
* * * * * { background-color: rgba(0,255,255,.2) !important; }\
@Baldrani
Baldrani / mockMang.js
Created May 15, 2019 03:59 — forked from kristianmandrup/mockMang.js
LevelUp Tuts: mockMang for testing Apollo GraphQL
import { makeExecutableSchema, addMockFunctionsToSchema } from "graphql-tools";
import { graphql } from "graphql";
import { ApolloClient } from "apollo-client";
import { from } from "apollo-link";
import { withClientState } from "apollo-link-state";
import { InMemoryCache } from "apollo-cache-memory";
import GoalsSchema from "../api/goals/Goal.graphql";
// import { defaultState } from '../ui/config/apollo/defaultState'
const defaultState = {};
@Baldrani
Baldrani / readme.md
Created September 29, 2018 14:09 — forked from benstr/readme.md
Gist Markdown Cheatsheet

#Heading 1 ##Heading 2 ###Heading 3 ####Heading 4 #####Heading 5 ######Heading 6


Paragraph

@Baldrani
Baldrani / git-deployment.md
Created September 29, 2018 12:40 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your lokal GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like my Deepl.io to act upon a Web-Hook that's triggered that service.

@Baldrani
Baldrani / client.js
Last active June 2, 2022 11:57 — forked from crtr0/client.js
[A simple example of setting-up dynamic "rooms" for socket.io clients to join] #javascript #wooly #sockets
// set-up a connection between the client and the server
var socket = io.connect();
// let's assume that the client page, once rendered, knows what room it wants to join
var room = "abc123";
socket.on('connect', function() {
// Connected, let's sign-up for to receive messages for this room
socket.emit('room', room);
});