Skip to content

Instantly share code, notes, and snippets.

View cauldyclark15's full-sized avatar

Joselie Castaneda cauldyclark15

View GitHub Profile
export const ContentWrapper = styled.div`
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05), 0 4px 24px 2px rgba(0, 0, 0, 0.1);
background: #fff;
transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
position: absolute;
left: ${({ showMainMenu }) => (showMainMenu ? '280px' : '60px')};
top: 0;
bottom: 0;
right: 0;
z-index: 1000;
@cauldyclark15
cauldyclark15 / Event-stream based GraphQL subscriptions.md
Created August 31, 2019 03:27 — forked from OlegIlyenko/Event-stream based GraphQL subscriptions.md
Event-stream based GraphQL subscriptions for real-time updates

In this gist I would like to describe an idea for GraphQL subscriptions. It was inspired by conversations about subscriptions in the GraphQL slack channel and different GH issues, like #89 and #411.

Conceptual Model

At the moment GraphQL allows 2 types of queries:

  • query
  • mutation

Reference implementation also adds the third type: subscription. It does not have any semantics yet, so here I would like to propose one possible semantics interpretation and the reasoning behind it.

@cauldyclark15
cauldyclark15 / Local PR test and merge.md
Created April 12, 2019 04:34 — forked from adam-p/Local PR test and merge.md
Testing a pull request, then merging locally; and avoiding TOCTOU

It's not immediately obvious how to pull down the code for a PR and test it locally. But it's pretty easy. (This assumes you have a remote for the main repo named upstream.)

Getting the PR code

  1. Make note of the PR number. For example, Rod's latest is PR #37: Psiphon-Labs/psiphon-tunnel-core#37

  2. Fetch the PR's pseudo-branch (or bookmark or rev pointer whatever the word is), and give it a local branch name. Here we'll name it pr37:

$ git fetch origin pull/37/head:pr37
@cauldyclark15
cauldyclark15 / box-shadow.html
Created December 20, 2018 15:52 — forked from ocean90/box-shadow.html
CSS3 Box Shadow, only top/right/bottom/left and all
<!DOCTYPE html>
<html>
<head>
<title>Box Shadow</title>
<style>
.box {
height: 150px;
width: 300px;
margin: 20px;
@cauldyclark15
cauldyclark15 / index.html
Created November 22, 2018 23:03 — forked from kentcdodds/index.html
The one true react boilerplate
<body>
<div id="⚛️"></div>
<script src="https://unpkg.com/react@16.0.0/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@16.0.0/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/babel-standalone@6.26.0/babel.js"></script>
<script type="text/babel">
ReactDOM.render(<div>Hello World!</div>, document.getElementById('⚛️'))
</script>
</body>
function SampleForm({ onSubmit, form: {getFieldDecorator} }) {
return (
<form
onSubmit={event => {
event.preventDefault();
const elementValues = getElementValues(event.target);
onSubmit(elementValues);
}}
>
@cauldyclark15
cauldyclark15 / osx_install.sh
Created June 5, 2018 07:46 — forked from t-io/osx_install.sh
Install most of my Apps with homebrew & cask
#!/bin/sh
echo Install all AppStore Apps at first!
# no solution to automate AppStore installs
read -p "Press any key to continue... " -n1 -s
echo '\n'
echo Install and Set San Francisco as System Font
ruby -e "$(curl -fsSL https://raw.github.com/wellsriley/YosemiteSanFranciscoFont/master/install)"
echo Install Homebrew, Postgres, wget and cask
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
function LinkedList () {
let Node = function (element) {
this.element = element
this.next = null
}
let length = 0
let head = null
this.append = function (element) {
import React from 'react';
import Loadable from 'react-loadable';
import Spinner from 'react-spinkit';
import { Route, Switch, Redirect } from 'react-router-dom';
import AppContainer from './AppContainer';
import { Wrapper } from './styles';
const loader = <Spinner name="ball-spin-fade-loader" className="loader" />;
import gql from 'graphql-tag';
import update from 'immutability-helper';
import { isEmpty } from 'lodash';
import { graphql } from 'react-apollo';
import {
accountInfo,
locationInfo,
meta,
notificationBasicInfo,