Skip to content

Instantly share code, notes, and snippets.

Tarjei Huse tarjei

Block or report user

Report or block tarjei

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tarjei
tarjei / InComponent.html
Last active Jun 6, 2018
Problem getting radio group to fire
View InComponent.html
<div class="form-gdpr">
<div class="form-gdpr-title">Ønsker du en gang i blant å bli kontaktet om spennende nye tilbud og tjenester?</div>
<div class="form-group check-group">
<label class="ip-label-check form-gdpr-ok" for="form-marketing">
<input type="radio"
value='1'
bind:group=userData.marketing
name="marketing"
class="ip-check"
id="form-marketing"/>
@tarjei
tarjei / LocalReducer.js
Created Sep 26, 2017
Recompose withReducer + withHandlers but as a simple render function component.
View LocalReducer.js
import React, { Component } from 'react'
import PropTypes from 'prop-types'
export default class LocalReducer extends Component {
static propTypes = {
handlers: PropTypes.object.isRequired,
mapPropsToInitialState: PropTypes.func.isRequired,
reducer: PropTypes.func.isRequired,
render: PropTypes.func.isRequired,
reducerKey: PropTypes.string
@tarjei
tarjei / router_v4_syntax_change.js
Created May 11, 2017
V4 routes optional syntax changed
View router_v4_syntax_change.js
// Before:
<route path="/path(:optional?)" />
// new
<route path="/path/:optional?" />
@tarjei
tarjei / my_enzyme_test.js
Created May 11, 2017
React Router V4 tests using enzyme to trigger route requires {button:0}
View my_enzyme_test.js
// will not trigger click:
page.find('a').simulate('click')
// works
page.find('a').simulate('click', {button:0})
View Link.js
@tarjei
tarjei / fixSpaces.php
Created Jan 3, 2017
Fix spaces in mysql rows
View fixSpaces.php
<?php
$host = '127.0.0.1';
$db = 'dbname';
$user = 'username';
$pass = 'password';
$charset = 'utf8';
$dsn = "mysql:host=$host;dbname=$db;charset=$charset";
$opt = [
@tarjei
tarjei / Modal.jsx
Created Jun 17, 2014
Foundation.reveal as a React.js component
View Modal.jsx
/**
* @jsx React.DOM
*/
var React = require('react/addons');
/* the link component is used to navigate away from th current url. Some of it is app spesific and
therefore not included here. */
var Link = require('../components/Link.jsx');
var cx = React.addons.classSet;
View README.md
@tarjei
tarjei / commit-msg
Created Apr 20, 2012
Git callaback to add issuenumber to commit message
View commit-msg
#!/bin/bash
#
# An example hook script to check the commit log message.
# Called by "git commit" with one argument, the name of the file
# that has the commit message. The hook should exit with non-zero
# status after issuing an appropriate message if it wants to stop the
# commit. The hook is allowed to edit the commit message file.
#
# Based on another example commit-msg hook I found here:
# https://review.typo3.org/Documentation/user-changeid.html
You can’t perform that action at this time.