Skip to content

Instantly share code, notes, and snippets.

View janogarcia's full-sized avatar

Jano Garcia janogarcia

View GitHub Profile
<!DOCTYPE html>
<meta charset=utf-8>
<meta name=viewport content="width=device-width, initial-scale=1">
<title>#merryCSSmas bundle</title>
<style>
* {
box-sizing: border-box;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
@bendc
bendc / easing.js
Last active November 15, 2022 11:54
Penner easing equations as arrow functions
// ease-in
const easeInQuad = (t, b, c, d) =>
c*(t/=d)*t + b;
const easeInCubic = (t, b, c, d) =>
c*(t/=d)*t*t + b;
const easeInQuart = (t, b, c, d) =>
c*(t/=d)*t*t*t + b;
@goncalossilva
goncalossilva / gifenc.sh
Last active December 12, 2023 22:31
Encode mp4, webm and gif using ffmpeg (2.6 or above). Audio is discarded on all of these!
#!/bin/sh
# sh gifenc.sh input.mp4 output.gif
# Optionally accepts width / height (one or both).
palette="/tmp/palette.png"
filters="fps=15"
if [ -n "$3" ]; then
if [ -n "$4" ]; then
filters="$filters,scale=$3:$4"
@bendc
bendc / functional-utils.js
Last active September 15, 2023 12:12
A set of pure ES2015 functions aimed to make functional JavaScript more idiomatic.
// array utils
// =================================================================================================
const combine = (...arrays) => [].concat(...arrays);
const compact = arr => arr.filter(Boolean);
const contains = (() => Array.prototype.includes
? (arr, value) => arr.includes(value)
: (arr, value) => arr.some(el => el === value)
@barryvdh
barryvdh / carousel.js
Last active March 21, 2024 01:10
Bootstrap Carousel, with jQuery fallback for Internet Explorer (To have sliding images)
@digitaljhelms
digitaljhelms / gist:4287848
Last active April 26, 2024 10:44
Git/GitHub branching standards & conventions

Branching

Quick Legend

Description, Instructions, Notes
Instance Branch
@gschema
gschema / intro.md
Last active November 27, 2023 04:35
Basic JavaScript MVC Implementation

Basic JavaScript MVC Implementation

Despite being derived from classical MVC pattern JavaScript and the environment it runs in makes Javascript MVC implementation have its own twists. Lets see how typical web MVC functions and then dive into simple, concrete JavaScript MVC implementation.

How Web MVC typically works

Typical server-side MVC implementation has one MVC stack layered behind the singe point of entry. This single point of entry means that all HTTP requests, e.g. http://www.example.com or http://www.example.com/whichever-page/ etc., are routed, by a server configuration, through one point or, to be bold, one file, e.g. index.php.

At that point, there would be an implementation of Front Controller pattern which analyzes HTTP request (URI at first place) and based on it decides which class (Controller) and its method (Action) are to be invoked as a response to the request (method is name for function and member is name for a variable when part of the class/object).

@topdown
topdown / CI_phpStorm.php
Created January 29, 2012 05:21
Code Completion for CodeIgniter in phpStorm
<?php die('This file is not really here!');
/**
* ------------- DO NOT UPLOAD THIS FILE TO LIVE SERVER ---------------------
*
* Implements code completion for CodeIgniter in phpStorm
* phpStorm indexes all class constructs, so if this file is in the project it will be loaded.
* -------------------------------------------------------------------
* Drop the following file into a CI project in phpStorm
* You can put it in the project root and phpStorm will load it.
@panicsteve
panicsteve / gist:1641705
Created January 19, 2012 18:26
Form letter template for acquired startups
Dear soon-to-be-former user,
We've got some fantastic news! Well, it's great news for us anyway. You, on
the other hand, are fucked.
We've just been acquired by:
[ ] Facebook
[ ] Google
[ ] Twitter
@skunkbad
skunkbad / MY_Controller.php
Created December 20, 2011 22:31
CodeIgniter 2.1.0 form validation external callbacks
<?php if( ! defined('BASEPATH') ) exit('No direct script access allowed');
/**
* CodeIgniter 2.1.0 form validation external callbacks.
*
* This is part of MY_Controller.php in Community Auth, which is an open
* source authentication application for CodeIgniter 2.1.0
*
* @package Community Auth
* @author Robert B Gottier
* @copyright Copyright (c) 2011, Robert B Gottier.