Skip to content

Instantly share code, notes, and snippets.

Working from home

Nkansah Rexford seanmavley

Working from home
Block or report user

Report or block seanmavley

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
seanmavley / sensible basic form.validation.react.tsx
Created Oct 30, 2019
Material UI Form with React Hook Form with Validation using Yup
View sensible basic form.validation.react.tsx
import React from "react";
import { makeStyles, createStyles, Theme } from '@material-ui/core/styles';
import Paper from '@material-ui/core/Paper';
import Grid from '@material-ui/core/Grid';
import Box from '@material-ui/core/Box';
import TextField from '@material-ui/core/TextField';
import Typography from '@material-ui/core/Typography';
import { Button } from '@material-ui/core';
import useForm from 'react-hook-form';
import * as yup from 'yup';
seanmavley / filterchips.dart
Last active Jun 27, 2018
Dynamic list for FilterChips
View filterchips.dart
class ActorFilterEntry<Widget> {
const ActorFilterEntry(,;
final String name;
final int id;
class InterestsFilterPage extends State<InterestPage> {
List<Widget> actorWidgets(interest) {
seanmavley / freeradius_monit
Created Dec 22, 2016
Monitor freeradius with Monit
View freeradius_monit
check process freeradius with pidfile /var/run/freeradius/
start program = "/etc/init.d/freeradius start"
stop program = "/etc/init.d/freeradius stop"
if failed host port 1812 type udp protocol radius secret testing123 then alert
if failed host port 1812 type udp protocol radius secret testing123 then alert
seanmavley / gulpfile.js
Created Jun 20, 2016
Reset build folder before gulp build then restart browser
View gulpfile.js
var gulp = require('gulp');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var del = require('del'); // rm -rf
var browser = require('browser-sync').create();
var port = process.env.SERVER_PORT || 3000;
gulp.task('clean', function() {
View phpStrtime in javascript.js
// first day of the month
var firstDayThisMonth = moment(firstDayThisMonth).startOf('month').toDate();
Go back and forth using the subtract() and add() with the endOf() and startOf():
// last day of previous month
var yesterMonthLastDay = moment(yesterMonthLastDay).subtract(1,'months').endOf('month').toDate();
seanmavley / network_available.js
Created Mar 29, 2016
check network connectivit
View network_available.js
// Register listeners
window.addEventListener("offline", function(){
$("#message").html('WARNING: Internet connection has been lost.').show();
window.addEventListener("online", function(){
seanmavley / forms for meteor.js
Created Mar 23, 2016
gather all form elements
View forms for meteor.js
(function() {
var form = document.getElementById('form_837299');
form.addEventListener('submit', function(event) {
// Prevent normal form submit
# backup using
# Usage:
# ./backup-script nameOfFolder
# e.g
# ~$ ./backup-script Folder SecondFolder
echo "Starting backup"
for i
seanmavley /
Created Jan 23, 2016 — forked from sgnn7/
Mongodb 3.2 on Ubuntu 15.10
echo '[Unit]
Description=High-performance, schema-free document-oriented database
ExecStart=/usr/bin/mongod -f /etc/mongod.conf
View primary.html
{% load pages_tags i18n mezzanine_tags %}
{% if page_branch_in_menu %}
{% if branch_level == 0 %}
<a href="#" data-activates="mobile-demo" class="button-collapse"><i class="material-icons">menu</i></a>
<ul class="right hide-on-med-and-down">
<li> <a class="modal-trigger" href="#searchbox"><i class="material-icons">search</i></a></li>
{% if user.is_authenticated %}
<li> <a href="{% url 'add_project' %}"><i class="material-icons">add</i></a></li>
{% endif %}
You can’t perform that action at this time.