Skip to content

Instantly share code, notes, and snippets.

@frob
frob / scrollTo.js
Last active February 2, 2023 14:37 — forked from james2doyle/scrollTo.js
a native scrollTo function in javascript that uses requestAnimationFrame and easing for animation
// easing functions http://goo.gl/5HLl8
Math.easeInOutQuad = function (t, b, c, d) {
t /= d/2;
if (t < 1) {
return c/2*t*t + b
}
t--;
return -c/2 * (t*(t-2) - 1) + b;
};
@frob
frob / emoji.php
Last active August 29, 2015 14:27 — forked from alanorth/emoji.php
Emoji class / function / variable names in PHP...
<?php
class 💩💩💩💩
{
function 💩💩💩($😎, $🐯)
{
return $😎 + $🐯;
}
}
$🐔 = 3;
@frob
frob / months.php
Created October 13, 2015 22:50
Long and short month names in a php array.
<?php
$short = array(
'Jan',
'Feb',
'Mar',
'Apr',
'May',
'Jun',
'Jul',
@frob
frob / custom_drupal.js
Last active October 14, 2015 20:56
a custom js implementation for drupal
/**
* @file
* Custom JS for a Drupal Module.
*/
(function ($) {
"use strict";
Drupal.behaviors.custom_custom = {
attach: function (context, settings) {
// End of attach.
@frob
frob / .eslintignore
Created November 7, 2015 00:09
Drupal ESlint settings. Taken from https://www.drupal.org/node/1955232
core/assets/vendor/**/*
core/modules/locale/tests/locale_test.js
core/vendor/**/*
sites/**/files/**/*
libraries/**/*
sites/**/libraries/**/*
profiles/**/libraries/**/*
**/js_test_files/**/*
@frob
frob / table.css
Created July 13, 2016 17:45
table layout fixed
table{table-layout:fixed;width:100%;}
tbody>tr>*:nth-last-child(2)~*{ width:50%}
tbody>tr>*:nth-last-child(3)~*{ width:33.3%}
tbody>tr>*:nth-last-child(4)~*{ width:25%}
[
{
"boys": [
"Adam",
"Alan",
"Aldo",
"Alex",
"Andy",
"Ari",
"Ben",
<?php
$database_suffix = '';
if (git_command_exists('git') && $git_describe = settings_execute_os_command('git rev-parse --abbrev-ref HEAD') ) {
if (trim($git_describe) == 'HEAD') {
$git_describe = settings_execute_os_command('git describe --all');
}
// Execute "git describe --all" and get the last part of heads/* as
// the tag/branch.
if (empty($git_describe)) {
@frob
frob / ansi-color.php
Created February 13, 2017 18:45 — forked from s4553711/ansi-color.php
ANSI color terminal output module for php
<?php
/**
* php-ansi-color
*
* Original
* https://github.com/loopj/commonjs-ansi-color
*
* @code
* <?php
* require_once "ansi-color.php";
07:58 $ vagrant up
Bringing machine 'oen-ode.local' up with 'virtualbox' provider...
==> oen-ode.local: Importing base box 'geerlingguy/centos7'...
==> oen-ode.local: Matching MAC address for NAT networking...
==> oen-ode.local: Checking if box 'geerlingguy/centos7' is up to date...
==> oen-ode.local: Setting the name of the VM: oen-ode.local
==> oen-ode.local: Clearing any previously set network interfaces...
==> oen-ode.local: Preparing network interfaces based on configuration...
oen-ode.local: Adapter 1: nat
oen-ode.local: Adapter 2: hostonly