Skip to content

Instantly share code, notes, and snippets.

View mimiflynn's full-sized avatar

Mimi Flynn mimiflynn

View GitHub Profile
@mimiflynn
mimiflynn / .tmux.conf
Last active January 6, 2017 22:34
tmux!
# ------------------------------------------------------------------------------
# Mimi's settings
set -g mouse on
# split panes using | and _
bind _ split-window
bind | split-window -h
unbind '"'
@mimiflynn
mimiflynn / form.js
Last active December 12, 2016 03:01
react methods snippets
import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import validator from 'email-validator';
import classnames from 'classnames';
const mockItems = [{
label: 'topic item one'
}, {
label: 'topic item two'
}];
@mimiflynn
mimiflynn / cookies.js
Created October 21, 2016 21:46
ES6 version of the mozilla lib
/*
* https://developer.mozilla.org/en-US/docs/Web/API/document.cookie
* https://developer.mozilla.org/User:fusionchess
*/
const getItem = (sKey) => {
if (!sKey) { return null; }
return decodeURIComponent(document.cookie.replace(new RegExp('(?:(?:^|.*;)\\s*' + encodeURIComponent(sKey).replace(/[\-\.\+\*]/g, '\\$&') + '\\s*\\=\\s*([^;]*).*$)|^.*$'), '$1')) || null;
};
@mimiflynn
mimiflynn / maps.js
Last active November 4, 2016 15:30
various utilities
import request from 'request';
/**
* Module of Google maps API utils
* @module /app/utils/maps
*/
// create a static map url
const createStaticMap = ({ lat, long }) => {
const url = 'https://maps.googleapis.com/maps/api/staticmap?center=' + lat + ',' + long + '&zoom=13&size=470x450&maptype=roadmap&markers=color:red%7Clabel:CityMD%7C' + lat + ',' + long + '&key=' + global.CONSTANTS.MAPS_KEY;
@mimiflynn
mimiflynn / fingless.md
Last active May 8, 2022 21:10
Scan local network without fing

Keybase proof

I hereby claim:

  • I am mimiflynn on github.
  • I am mimiflynn (https://keybase.io/mimiflynn) on keybase.
  • I have a public key whose fingerprint is 0BEC 6013 5335 5184 4466 36C7 4F5E D03D C99A 19CD

To claim this, I am signing this object:

@mimiflynn
mimiflynn / view-utils.js
Created March 25, 2016 19:23
various view utilities in ES6
const updateActive = (node) => {
// remove active class from all items
Array.prototype.forEach.call(node.parentNode.children, (e) => {
e.className = e.className.split(' active').join('');
});
// add active class to correct item
node.className = node.className + ' active';
}
@mimiflynn
mimiflynn / greeting-time.js
Last active June 15, 2017 14:52
Fun little JS utils for life things
// Morning Afternoon or Evening?
const getGreetingTime = (m) => {
let g = null;
if (!m || !m.isValid()) {
return; // exit if not a moment object
}
let split_afternoon = 12 // 24hr time to split the afternoon
let split_evening = 17 // 24hr time to split the evening
#!/bin/bash
# GUI-related packages
pkgs="
xserver-xorg-video-fbdev
xserver-xorg xinit
gstreamer1.0-x gstreamer1.0-omx gstreamer1.0-plugins-base
gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-alsa
gstreamer1.0-libav
epiphany-browser
var velocity = function (el, header) {
var wWidth = $(window).width(),
spacing = $(header).height(),
offset = $(el).offset();
// Create consistent velocity!
// Perfect velocity = 2550px per 3000milliseconds = .85 you know, since v = d/t
var current = window.pageYOffset;