First, install the gist
command using brew install gist
, then add this to your .zshrc (or whatever).
By default this will:
- create all gists as secret (
-p
) - copy the gist url to the clipboard (
-c
) - open the browser to the gist (
-o
)
<?php | |
function get_tag_id_by_name($tag_name) { | |
global $wpdb; | |
$tag_ID = $wpdb->get_var("SELECT * FROM ".$wpdb->terms." WHERE `name` = '".$tag_name."'"); | |
return $tag_ID; | |
} | |
?> |
{run} = require '@cycle/core' | |
{Observable} = require 'rx' | |
{div, input, h2, makeDOMDriver} = require '@cycle/dom' | |
intent = (domSource) => | |
changeWeight$ = domSource | |
.select('#weight').events('input') | |
.map((ev) => ev.target.value) | |
changeHeight$ = domSource | |
.select('#height').events('input') |
const webpack = require('webpack') | |
const path = require('path') | |
module.exports = { | |
entry: { | |
// the app bundle | |
main: path.join(__dirname, 'app.js'), | |
// the vendor bundle, white-list stuff here | |
vendor: [ 'react', 'react-dom' ] |
import { graphql } from "graphql"; | |
import { Schema, Type, Field, IntType, StringField } from "../schema"; | |
it("creates an executable schema", async () => { | |
// build field resolvers | |
// these will implement Functor and Semigroup (and maybe more) | |
const code = Field(IntType, ({ code }) => code); | |
const message = StringField(({ message }) => message); | |
// create a type from defined fields |
The HIT License (HIT) | |
Copyright (c) 2017 Ken Wheeler | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
To get syntax highlighting for ESNext (including JSX), you need to have pygments-lexer-babylon
installed:
pip install pygments pygments-lexer-babylon
Now when you run pygmentize
on a .jsx
file it'll automatically use the new lexer! 🎉
In your repo's root directory, check in a requirements.txt with
boto==2.30.0
Then, from the project's Project Settings > Environment Variables page, add the two env vars: AWS_ACCESS_KEY_ID and AWS_SECRET_KEY, with an IAM key that can deploy to eb.
Then create a bash script to set up eb:
{ | |
"presets": [ | |
["es2015", { | |
"es2015": { | |
"loose": true, | |
"modules": false | |
} | |
}], "react" | |
] | |
} |
import ModalContext from './modal-context'; | |
class Parent extends Component { | |
render() { | |
return ( | |
<ModalContext.Provider value={this.state.modalContext}> | |
<Child/> | |
</ModalContext.Provider> | |
); | |
} |