Skip to content

Instantly share code, notes, and snippets.

View greaveselliott's full-sized avatar

Elliott Greaves greaveselliott

  • London, UK
View GitHub Profile
/**
* Responsive mixin. The media breakpoints are as defined
* in the twitter bootstrap framework:
*
* - phone
* - tablet-portrait
* - tablet-landscape-desktop
* - large-desktop
*
* Additional parameters for tagetting retina and non-retina
// Block Grid
// Technique adapted from Foundation 5 for Bootstrap 3.
// https://github.com/zurb/foundation/blob/f755d8704123f86c281ede0b171881e2672f150d/scss/foundation/components/_block-grid.scss
// Original LESS Version by Christopher Mitchell (https://gist.github.com/ChrisTM)
// Converted to SCSS by Rasmus Jürs (https://github.com/Jursdotme)
[class*="block-grid-"] {
display: block;
margin: -($grid-gutter-width/2);
padding: 0;
@greaveselliott
greaveselliott / disable-wordpress-admin-updates.php
Created November 3, 2015 11:38
Prevents users from updating their WordPress installation
<?php
add_action('admin_menu','wphidenag');
function wphidenag() {
remove_action( 'admin_notices', 'update_nag', 3 );
}
add_action('admin_head', 'my_custom_fonts');
function my_custom_fonts() {
echo '<style>
function simpleFilter(people) {
return people.filter(function(person){
return person.age >= 30 && person.age <= 40 && person.gender === "male";
});
}
@greaveselliott
greaveselliott / search-js-object
Created February 28, 2018 01:20
Searches JS object for values
function find_property(object, property) {
var results = [];
for (var key in object) {
if (object !== undefined) {
var value = object[key];
if (key === property) {
results.push({
"property": key,
"value": value
@greaveselliott
greaveselliott / App.jsx
Last active June 22, 2019 20:11
medium-reduxless-view
import React from "react";
import "./app.scss";
export default function App() {
return (
<main className="app">
<h1 className="app__title">To do list</h1>
<form className="app__form">
<input type="text" className="app__input" />
import { createContext } from "react";
export const Store = createContext();
import { createContext } from "react";
export const Store = createContext();
const initialState = {
list: []
};
import React, { createContext, useReducer, useDebugValue } from "react";
import reducer from "./reducer";
export const Store = createContext();
const initialState = {
list: []
};
export function StoreProvider(props) {
import React, { createContext, useReducer } from "react";
import reducer from "./reducer";
export const Store = createContext();
const initialState = {
list: []
};
export function StoreProvider({ children }) {