Skip to content

Instantly share code, notes, and snippets.

View stipsan's full-sized avatar

Cody Olsen stipsan

View GitHub Profile
<?php
########################################################
# Author : Sebastian Grinke #
# Homepage : http://sebastiangrinke.info #
# E-Mail : [email protected] #
# Copyright : Copyright © 2008 - 2009 Sebastian Grinke #
# #
# Dieses Dokument darf verändert werden aber das #
# Copyright muss erhalten bleiben. #
########################################################
/*!
* jQuery JavaScript Library v1.6.2
* http://jquery.com/
*
* Copyright 2011, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* Includes Sizzle.js
* http://sizzlejs.com/
let AnimationWrapper = React.createClass({
render() {
console.log(this.props.childClassName + ' render');
return this.props.children;
},
componentWillAppear (callback) {
console.log(this.props.childClassName + ' willappear');
callback();
@stipsan
stipsan / rec2gif.sh
Created July 28, 2015 07:15
Shell script for converting screenrecordings and mpeg4 movies to great quality gifs
# Convert an animated video to gif
#
# Works well with both screencaptures from quicktime (.mov) and recordings from iOS (.mp4)
#
# @param $1 - video file name like `animation.mov`
# @param $2 - the output gif name like `animation.gif`
# @param @optional $3 - resize parameter as widthxheight like `400x300`
#
# Example: rec2gif animation.mov animation.gif 400x300
# Requirements: ffmpeg and gifsicle. Can be downloaded via homebrew
@stipsan
stipsan / yarn.sh
Last active March 27, 2017 09:31
Greenkeeper + yarn + travis ci = <3
#!/bin/bash
# Installation instructions for Travis CI, example repo using it in production: https://github.com/stipsan/uikit-react
# .travis.yml
# before_install: "bash <(curl -sL https://gist.github.com/stipsan/e69536d1a22c08e6e4feb4e14844face/raw/)"
echo "Should yarn.lock be regenerated?"
if [[ $TRAVIS_PULL_REQUEST_BRANCH != *"greenkeeper"* ]]; then
echo "Not a GreenKeeper Pull Request, aborting"
@stipsan
stipsan / legacy.less
Last active March 27, 2017 13:39
UIkit migrating from v2 to v3
@contrast-color: #fff;
@contrast-nav-side-active-background: @contrast-color;
@navbar-nav-height: 40px;
@stipsan
stipsan / add-test.js
Created June 9, 2017 20:11
null created by stipsan - https://repl.it/Ieo5/0
const add = require('./add');
describe('add', () => {
it('should add two numbers', () => {
expect(add(1, 2)).toBe(3)
});
});
@stipsan
stipsan / Sidebar-test.jsx
Last active June 16, 2017 09:34
Testing with Jest: Tip #1
import renderer from 'react-test-renderer'
import Sidebar from '../Sidebar'
jest.mock('react-router-dom/Link', () => 'Link')
it('should render correctly', () => {
const component = renderer.create(<Sidebar />)
expect(component.toJSON()).toMatchSnapshot()
})
@stipsan
stipsan / Sidebar-test.jsx
Last active June 16, 2017 09:35
Testing with Jest: Tip #2
import renderer from 'react-test-renderer'
import Sidebar from '../Sidebar'
jest.mock('react-router-dom', () => ({ Link: 'Link' }))
it('should render correctly', () => {
const component = renderer.create(<Sidebar />)
expect(component.toJSON()).toMatchSnapshot()
})
@stipsan
stipsan / Header-test.jsx
Last active June 16, 2017 09:40
Testing with Jest: Tip #4
import renderer from 'react-test-renderer'
import Header from '../Header'
import store from '../store'
jest.mock('react-redux-loading-bar', () => {
const ReactReduxLoadingBar = require.requireActual('react-redux-loading-bar')
return {
// Spread out the original module
...ReactReduxLoadingBar,