Skip to content

Instantly share code, notes, and snippets.

View paulruescher's full-sized avatar

Paul Ruescher paulruescher

  • Rivian
  • Vancouver, BC
View GitHub Profile
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",
},
];
@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 TextField = React.createClass({
displayName: 'TextField',
renderLabelText() {
if (!this.props.label) return null;
return (
<span>{this.props.label}</span>
);
@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]];
}));
}
});
[merge]
tool = sublimerge
[mergetool "sublimerge"]
cmd = sublime -n --wait \"$REMOTE\" \"$BASE\" \"$LOCAL\" \"$MERGED\" --command \"sublimerge_diff_views\"
trustExitCode = false
[diff]
tool = sublimerge
#!/bin/bash
# backend/run
echo -n -e "\033]0;Rails\007"
foreman start
echo -n -e "\033]0;\007"
@paulruescher
paulruescher / gist:5224004
Created March 22, 2013 19:25
Twitter Feed
// Twitter Feed
add_shortcode( 'twitter', 'rl_twitter_feed' );
function rl_twitter_feed( $atts ) {
// Attributes
if( isset( $atts['handle'] ) )
$handle = $atts['handle'];
// Check transients
$body = get_transient( 'rl_twitter_data' );
@paulruescher
paulruescher / gist:5106618
Created March 7, 2013 09:04
Remove File From Git Repository
git rm --cached myFile.ext
@paulruescher
paulruescher / gist:5034090
Created February 25, 2013 22:54
Convert hexadecimal color to rgba
/**
* Converts hexidecimal to rgb format
*/
function lab_hex_to_rgb( $hex, $opacity = 1 ) {
$hex = str_replace( '#', '', $hex );
// if in 3 digit format
if( strlen( $hex ) == 3) {
@paulruescher
paulruescher / gist:5026277
Created February 24, 2013 23:43
Set Ember Data Adapter URL
App.Store = DS.Store.extend({
revision : 11,
adapter : DS.RESTAdapter.create({
url : 'https://proposals.firebaseio.com'
}),
});