Skip to content

Instantly share code, notes, and snippets.

View timgthomas's full-sized avatar

Tim G. Thomas timgthomas

View GitHub Profile
@timgthomas
timgthomas / hexo.Dockerfile
Last active January 3, 2021 21:39
Dockerfiles
FROM spurin/hexo
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install
EXPOSE 4000
CMD ["yarn", "start"]
@timgthomas
timgthomas / commit.sh
Last active June 20, 2018 20:41
Jira Issue–Aware Commit Function
# Usage:
# APP-1337 $ commit 'foo'
# > 'APP-1337: foo'
function commit {
local message=$1
local branch=$(git symbolic-ref HEAD)
local regex="([A-Z]+-[0-9]+)"
if [[ $branch =~ $regex ]]
then
import Ember from 'ember';
export default Ember.Controller.extend({
items: Ember.computed('model.@each.{hostname,port}', function() {
return JSON.stringify(this.get('model'));
}),
actions: {
addItem() {
this.get('model').pushObject({});
},
@timgthomas
timgthomas / arrows.js
Created October 26, 2015 14:30
Arrow (Fun)ctions
Ember.Component.extend({
computed: Ember.computed(() => {
this.foo();
})
})
// ...transpiles to...
/*
var _this = undefined;
export default Ember.Component.extend({
init() {
this._super();
this.get('item').on('saved', this.itemSaved.bind(this));
},
itemSaved() {
this.$().css({ color: 'deeppink' });
}
});
@timgthomas
timgthomas / gist:b1c0563e388808061e35
Created March 26, 2015 18:54
Universal Selector Gotcha
/* This is bad, as it doesn't allow values to cascade. */
* {
box-sizing: border-box;
font-weight: 500;
/* ... */
}
/* This is good. Do this instead. */
.container {
display: table;
}
.container input {
display: table-cell;
}
@timgthomas
timgthomas / dabblet.css
Created May 28, 2013 18:52
CSS Checkbox Replacement
* { padding: 0; margin: 0; }
p {
border: 1px solid #eee;
line-height: 24px;
overflow: hidden;
margin: 30px;
padding: 5px;
}
div {
border-radius: 50px;
color: #f0f;
font-size: 128px;
text-align: center;
margin: 0 auto;
padding: 0 0 24px;
position: relative;
width: 200px;
}
@timgthomas
timgthomas / dabblet.css
Created February 27, 2013 15:59
Untitled
span { display: none; }
div:hover span { display: inline; }