Skip to content

Instantly share code, notes, and snippets.

@EmperorEarth
EmperorEarth / gist:6337dd6243dc5315ad12
Created November 8, 2015 07:49
clutch toggle csgo
alias "clutchtoggle" "clutchon"
alias "clutchon" "voice_scale 0; say_team ---; alias clutchtoggle clutchoff"
alias "clutchoff" "voice_scale 1; say_team ---; alias clutchtoggle clutchon"
bind "y" "clutchtoggle"
/** @jsx React.DOM */
'use strict';
var React = require("react/addons");
var _ = require("lodash");
var $ = require("jquery");
var AtomReact = require("atom-react");
var classNames = require('classnames');
@diegoconcha
diegoconcha / redux_egghead_notes.md
Last active January 18, 2022 13:23
Redux Egghead.io Notes

###Redux Egghead Video Notes###

####Introduction:#### Managing state in an application is critical, and is often done haphazardly. Redux provides a state container for JavaScript applications that will help your applications behave consistently.

Redux is an evolution of the ideas presented by Facebook's Flux, avoiding the complexity found in Flux by looking to how applications are built with the Elm language.

####1st principle of Redux:#### Everything that changes in your application including the data and ui options is contained in a single object called the state tree

Legend

This is a command in the Docker Quickstart Terminal

$ This is a command run inside the docker host or inside a container (linux etc, eg after docker-machine ssh default or docker run -it ubuntu bash)

Install Docker Toolbox

  1. start docker quick-start terminal
import { mockServer, MockList } from 'graphql-tools';
import casual from 'casual-browserify';
// The GraphQL schema. Described in more detail here:
// https://medium.com/apollo-stack/the-apollo-server-bc68762e93b
const schema = `
type User {
id: ID!
name: String
@schmohlio
schmohlio / sse.go
Last active August 21, 2024 05:00 — forked from ismasan/sse.go
Example SSE server in Golang
// v2 of the great example of SSE in go by @ismasan.
// includes fixes:
// * infinite loop ending in panic
// * closing a client twice
// * potentially blocked listen() from closing a connection during multiplex step.
package main
import (
"fmt"
"log"
@markerikson
markerikson / hmr-and-deps.md
Last active October 30, 2018 17:36
Webpack/HMR reload times and file structure dependency chains

Here's a sample scenario. Let's say we're using a "feature-first" folder structure based in /src, and we're trying to use index.js files to re-export files deeper in the hierarchy as a way of defining a sort of "public API" for a given feature folder. A sample of this might look like:

/features/A/ComponentA.jsx

export default ComponentA = () => (
    <div>Component A</div>
);

/features/A/actions.js

@paralin
paralin / 1_GraphQL.md
Last active July 3, 2018 19:28
GraphQL @defer, @LiVe, @stream implementation notes

Notes moved from graph-gophers/graphql-go#15

Graphql-js can parse directives like @live just fine -

parsed.definitions[0].selectionSet.selections[0].selectionSet.selections[0].directives[0] =
{ kind: 'Directive',
  name: { kind: 'Name', value: 'live', loc: { start: 26, end: 30 } },
  arguments: [],
 loc: { start: 25, end: 30 } }
@robbiev
robbiev / go-playground-vim.md
Last active July 26, 2021 14:55
vim keybindings for the Go Playground at https://play.golang.org

Wasavi is some sort of vim implementation for browser text fields.

Once installed go to https://play.golang.org, you can use INSERT or CTRL+ENTER to enter the vim mode. To quit use the usual vim commands.

Tips:

  • The default keybinding to enter vim mode, CTRL+ENTER, conflicts with the standard playground shortcuts (CTRL+ENTER to format, SHIFT+ENTER to run). I recommend configuring wasavi to not enter vim mode on CTRL+ENTER (just use INSERT or configure something else)
  • Once you remapped CTRL+ENTER, you can have the following workflow:
class Dashboard extends Component {
constructor(props) {
super(props)
// bind? slows down the initialization path, looks awful
// when you have 20 of them (I have seen your code, I know)
// and it increases bundle size
this.handleStuff = this.handleStuff.bind(this)
// _this is ugly.