Skip to content

Instantly share code, notes, and snippets.

View kkemple's full-sized avatar

Kurt Kemple kkemple

View GitHub Profile
@cfpg
cfpg / gist:972764
Created May 14, 2011 23:42
WordPress: Get Tag ID when you only have the Tag name
<?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;
}
?>
@remy
remy / _readme.md
Last active February 4, 2016 17:07
gist cli helper

Gist cli helper

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)
@staltz
staltz / cycle-bmi.coffee
Created March 3, 2016 15:32
Cycle.js example in CoffeeScript
{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' ]
@jbaxleyiii
jbaxleyiii / heighliner.js
Last active May 4, 2017 22:44
Heighliner [Functional GraphQL Server Framework]
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:
@mxstbr
mxstbr / README.md
Last active September 1, 2017 02:02
Syntax highlighting ESNext (inc. JSX) for Keynote presentations

Syntax Highlighting ESNext (inc. JSX)

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! 🎉

@dwwoelfel
dwwoelfel / gist:b859cee4b5f41af37ffd
Created August 1, 2014 21:05
Rough notes for setting up elastic beanstalk on CircleCI

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:

@JamieMason
JamieMason / .babelrc
Created December 5, 2016 08:41
Tree-Shaking with Babel 6, Webpack 2, and React.
{
"presets": [
["es2015", {
"es2015": {
"loose": true,
"modules": false
}
}], "react"
]
}
@jamesplease
jamesplease / 0.provider.jsx
Last active February 1, 2018 00:42
Hello
import ModalContext from './modal-context';
class Parent extends Component {
render() {
return (
<ModalContext.Provider value={this.state.modalContext}>
<Child/>
</ModalContext.Provider>
);
}