Skip to content

Instantly share code, notes, and snippets.

View tomfordweb's full-sized avatar
🏠
Working from home

Tom Ford tomfordweb

🏠
Working from home
View GitHub Profile
@gaborify
gaborify / isIE.js
Created June 6, 2017 12:43
Detect IE with JavaScript #ie #edge #js #javascript
// Forked from https://codepen.io/gapcode/pen/vEJNZN
// Get IE or Edge browser version
var version = detectIE();
if (version === false) {
document.getElementById('result').innerHTML = '<s>IE/Edge</s>';
} else if (version >= 12) {
document.getElementById('result').innerHTML = 'Edge ' + version;
} else {
@krambertech
krambertech / Component.jsx
Created July 2, 2016 10:44
ReactJS: Input fire onChange when user stopped typing (or pressed Enter key)
import React, { Component } from 'react';
import TextField from 'components/base/TextField';
const WAIT_INTERVAL = 1000;
const ENTER_KEY = 13;
export default class TextSearch extends Component {
constructor(props) {
super();
@wgrafael
wgrafael / functions.php
Last active July 6, 2023 18:04
Convert array with key in dot notation for multidimensional array
<?php
/**
* Convert array with key in dot notation for multidimensional array
*
* Example:
* Input: [ "name.firstname" => "Rafael", "name.lastname" => "Dantas", "a.b.c" => "d" ]
* Output: [ "name" => [ "firstname" => "Rafael", "lastname" => "Dantas" ], "a" => [ "b" => [ "c" => "d" ] ]
*
* @param $array Array with key in dot notation
@mattclements
mattclements / function.php
Last active June 25, 2025 13:13
Wordpress Disable Comments (add to function.php)
<?php
add_action('admin_init', function () {
// Redirect any user trying to access comments page
global $pagenow;
if ($pagenow === 'edit-comments.php') {
wp_redirect(admin_url());
exit;
}
@ericlbarnes
ericlbarnes / .bowerrc
Created January 17, 2015 03:33
Laravel Elixir With Bootstrap Sass
{
"directory": "vendor/bower_components"
}
@billerickson
billerickson / gist:3698476
Last active February 23, 2024 16:49 — forked from luetkemj/wp-query-ref.php
WP: Query $args
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
@loonies
loonies / 1_phpunit-api.md
Last active September 24, 2024 14:55
PHPUnit Cheat Sheet

PHPUnit API reference

  • version 3.6

TODO

Check those constraints:

$this-&gt;anything()