Skip to content

Instantly share code, notes, and snippets.

View hannigand's full-sized avatar
🎯
Focusing

Dan Hannigan hannigand

🎯
Focusing
  • London
View GitHub Profile
const uploadFile = (file, callback) => {
const date = Date.now();
const signature = `timestamp=${date}`;
RNFetchBlob.fetch(
'POST',
'https://api.cloudinary.com/v1_1/BUCKET_NAME/video/upload',
{
'Content-Type': 'multipart/form-data'
},
[
@hannigand
hannigand / Playing with Webpack
Created October 6, 2017 08:55
A simple Webpack config to build CSS, images and fonts.
const path = require('path');
module.exports = {
entry: './src/index.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist'),
},
module: {
rules: [
import React, { Component } from "react";
import {
Modal,
View,
Text,
WebView,
Dimensions,
TouchableOpacity,
} from "react-native";
import Icon from "react-native-vector-icons/Ionicons";
import React from 'react';
import ReactDOM from 'react-dom';
import {
Router,
Route,
browserHistory
} from 'react-router'
import Header from './Components/Header';
import DayPicker from './Components/DayPicker';
getActiveItems() {
const { filterVideos, videos, structuredVideos, unstructuredVideos} = this.state;
let item = null;
let activeItem = null;
if(!filterVideos || filterVideos === 'all') {
item = videos
activeItem = 'all';
} else if (filterVideos === 'structured') {
item = structuredVideos;
activeItem = 'structured';
render() {
let item = null;
let activeItem = null;
if(!this.state.filterVideos || this.state.filterVideos === 'all') {
item = this.state.videos
activeItem = 'all';
} else if (this.state.filterVideos === 'structured') {
item = this.state.structuredVideos;
activeItem = 'structured';
} else if ( this.state.filterVideos === 'unstructured') {
if(!this.state.filterVideos || this.state.filterVideos === 'all') {
return (
<View>
<ScrollView>
<View style={ styles.container }>
<InfoBar
message="Please note, your CPD record can take up to 24 hours to update"
/>
<TabBar
filterVideos={ this.filterVideos }
@hannigand
hannigand / spritesheet
Last active August 29, 2015 14:05
Playing with Spritesheets with Sass
$icon-width: 24px;
$icon-height: 24px;
$icon-tile-x: 10;
$icons: 'http://danhannigan.co.uk/social_spritesheet.png';
%social-icon {
width: $icon-width;
height: $icon-height;
background-image: url($icons);
display: block;