Skip to content

Instantly share code, notes, and snippets.

View sammdec's full-sized avatar

Sam Mason de Caires sammdec

View GitHub Profile
class ManequinGallery extends React.Component {
ESCAPE_KEY = 27
state = {
zoomedImage: false,
isPanning: false,
left: 0,
top: 0
};
const handleSelectUpdate = (target) => {
return { [target.name]: target.value };
};
handleChosenCountry: (state, target) =>
const selectState = handleSelectUpdate(target);
const newState = handleChosenCountry(state, target.value)
handleFetchEvents({ ...state, chosenCountry: selectState.country }).then(res => {
store.setState({
@sammdec
sammdec / posts.js
Last active November 8, 2017 13:48
{
[
date: "2017-11-08 00:00:00 UTC",
posts: [
{
id: 4,
votes: 100,
created_at: "2017-11-08 13:00:00 UTC"
},
{
@sammdec
sammdec / keybase.md
Last active November 25, 2019 15:46

Keybase proof

I hereby claim:

  • I am samjbmason on github.
  • I am samjbmason (https://keybase.io/samjbmason) on keybase.
  • I have a public key ASDneB6f5DSZyXY7-pL61i1qtd1FFIBMz4E3f059GOz8Two

To claim this, I am signing this object:

create_table "project_files", force: true do |t|
t.string "name"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "project_id"
t.integer "user_id"
end
create_table "projects", force: true do |t|
t.string "name"
@sammdec
sammdec / gist:10645922
Created April 14, 2014 13:03
Link Detecttion Regex
var regEx = /(\b(https?|ftp|file):\/\/[\-A-Z0-9+&@#\/%?=~_|!:,.;]*[\-A-Z0-9+&@#\/%=~_|])/img;
var gulp = require('gulp'),
gutil = require('gulp-util'),
sass = require('gulp-sass'),
imagemin = require('gulp-imagemin');
var paths = {
css: 'css/style.css',
img: 'img/**/*''
};
@sammdec
sammdec / alfred-stack-search.md
Last active May 19, 2020 02:47
Add StackOverflow search to Alfred

To search Stack Overflow from alfred app, simply copy and paste below into the alfred search box, when you press enter you shoudl see a dialog asking you to install this custom Search.

alfred://customsearch/Search%20StackOverflow%3A%20%7Bquery%7D/stack/utf8/noplus/http://stackoverflow.com/search?q={query}

Then to use it in alfred simply up the search box and type in stack and the question your asking.

@sammdec
sammdec / hash.rb
Created August 1, 2013 09:32
the hash return from using psd.rb gem
{:children=>
[{:type=>:group,
:visible=>true,
:opacity=>1.0,
:blending_mode=>"normal",
:name=>"Layer 1",
:left=>-4,
:right=>1206,
:top=>-5,
:bottom=>1051,
@sammdec
sammdec / before-header.html
Created May 7, 2013 21:51
Header.html Markup for Meteor Book
<template name="header">
<header class="navbar">
<div class="navbar-inner">
<a class="brand" href="/">Microscope</a>
<ul class="nav pull-right">
<li>{{loginButtons}}</li>
</ul>
</div>
</header>
</template>