Skip to content

Instantly share code, notes, and snippets.

View paulruescher's full-sized avatar

Paul Ruescher paulruescher

  • Rivian
  • Vancouver, BC
View GitHub Profile
[merge]
tool = sublimerge
[mergetool "sublimerge"]
cmd = sublime -n --wait \"$REMOTE\" \"$BASE\" \"$LOCAL\" \"$MERGED\" --command \"sublimerge_diff_views\"
trustExitCode = false
[diff]
tool = sublimerge
@paulruescher
paulruescher / gist:f59345f56e37973e7be2
Created May 5, 2015 18:13
lodash mixin for camel casing object keys
_.mixin({
'camelCaseKeys' : function(obj) {
return _.object(_.map(_.pairs(obj), function(pair) {
return [_.camelCase(pair[0]), pair[1]];
}));
}
});
const TextField = React.createClass({
displayName: 'TextField',
renderLabelText() {
if (!this.props.label) return null;
return (
<span>{this.props.label}</span>
);
@paulruescher
paulruescher / gist:4ff11af09efe2165151d
Created September 29, 2015 17:09
React Project Structure
app
├── config
│ └── routes.js
├── screens
│ └── App
│ ├── components
│ ├── screens
│ │ ├── Admin
│ │ │ ├── components
│ │ │ ├── screens
const notifications = [
{
date: "Nov 10, 2015 8:00:00",
message: "Tagged in a photo",
},
{
date: "Nov 10, 2015 9:00:00",
message: "Mentioned in a post",
},
];
const notifications = [
{
date: "Nov 10, 2015 8:00:00",
message: "Tagged in a photo",
},
{
date: "Nov 10, 2015 9:00:00",
message: "Mentioned in a post",
},
];
const notifications = [
{
date: "Nov 10, 2015 8:00:00",
message: "Tagged in a photo",
},
{
date: "Nov 10, 2015 9:00:00",
message: "Mentioned in a post",
},
];
function f(x) {
return x * 10;
}
function g(x) {
return x + 2;
}
f(g(2)); // 40
function fullName(firstName, lastName) {
return `${firstName} ${lastName}`;
}
function createEl(el) {
return document.createElement(el);
}
function wrapContentWithEl(el, content) {
return el.innerHTML = content;
const Container = React.createClass({
componentDidMount() {
const success = (notifications) => {
this.setState({
notifications: notifications,
});
};
$.ajax({
url: '/notifications',