Skip to content

Instantly share code, notes, and snippets.

View elliotec's full-sized avatar
😎

Mike Elliott elliotec

😎
View GitHub Profile
componentDidMount() {
window.addEventListener('scroll', this.throttleGoogleAdScroll());
}
throttleGoogleAdScroll() {
// listen and throttle the scroll every second at start and end of scroll
return _throttle(this.handleShowGoogleAdsense,
1000,
{ trailing: true, leading: true }
);
componentDidMount() {
this.alignBreadcrumbs();
}
alignBreadcrumbs() {
if (this.breadcrumbSection.scrollWidth > this.breadcrumbSection.offsetWidth) {
this.breadcrumbSection.style.direction = 'rtl';
}
}
app.get('/characters', function (req, res) {
let mappedCharacters = [];
function mapResults(json){
mappedCharacters.push(json);
return mappedCharacters;
}
function reducePages(pages){
return pages.reduce((acc, curr) =>
const express = require('express');
const fetch = require('node-fetch');
const app = express();
const swapi = 'http://swapi.co/api';
app.set('view engine', 'ejs');
app.get('/', function (req, res) {
res.render('index', {heading: 'Hello Grow!'});
});
// An All Components Screen is a great way to dev and quick-test components
import React from 'react'
import { View, ScrollView, Text, Image, NetInfo, TouchableOpacity } from 'react-native'
import DeviceInfo from 'react-native-device-info'
import { Metrics, Images } from './DevTheme'
import styles from './Styles/DeviceInfoScreenStyles'
const HARDWARE_DATA = [
{title: 'Device Manufacturer', info: DeviceInfo.getManufacturer()},
{title: 'Device Name', info: DeviceInfo.getDeviceName()},
const itemsById = itemsWithFields.reduce(
(accum, item) => {
const itemId = item.sys.id;
accum[itemId] = item;
return accum;
}, []
);
console.log(itemsById);
" This file should be at ~/.config/nvim/init.vim
call plug#begin('~/.nvim/plugged')
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins'}
Plug 'carlitux/deoplete-ternjs'
Plug 'gioele/vim-autoswap'
Plug 'vim-scripts/YankRing.vim'
Plug 'ervandew/supertab'
Plug 'neomake/neomake'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-fugitive'
" This file should be at ~/.config/nvim/init.vim
call plug#begin('~/.nvim/plugged')
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins'}
Plug 'carlitux/deoplete-ternjs'
Plug 'gioele/vim-autoswap'
Plug 'vim-scripts/YankRing.vim'
Plug 'ervandew/supertab'
Plug 'w0rp/ale'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-fugitive'
" This file should be at ~/.config/nvim/init.vim
call plug#begin('~/.nvim/plugged')
" Autocomplete list functionality
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins'}
" Autocomplete with tern for JavaScript
Plug 'carlitux/deoplete-ternjs'
" Automatically handle swapfiles
Plug 'gioele/vim-autoswap'
" Keep list of yanks, use Ctrl-p to scroll through
Plug 'vim-scripts/YankRing.vim'
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-pain-control'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-sessionist'
set -g @plugin 'nhdaly/tmux-scroll-copy-mode'
set -g @plugin 'tmux-plugins/tmux-open'
set -g @plugin 'tmux-plugins/tmux-copycat'