Skip to content

Instantly share code, notes, and snippets.

View kggayo's full-sized avatar
🎯
Focusing

Kevin Gayo kggayo

🎯
Focusing
View GitHub Profile
@kggayo
kggayo / text-decoration_underline.css
Created June 23, 2017 04:19
Vertical spacing in text-decoration: underline using CSS
/*
Adjust vertical space by adjusting 71%
Adjust line thickness by adjusting 71% and 72%
*/
a:hover {
background: -moz-linear-gradient(top, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 71%, #FFFFFF 71.1%, #FFFFFF 72%, rgba(0,0,0,0) 72.1%, rgba(0,0,0,0) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0,0,0,0)), color-stop(71%,rgba(0,0,0,0)), color-stop(71.1%,#FFFFFF), color-stop(72%,#FFFFFF), color-stop(72.1%,rgba(0,0,0,0)), color-stop(100%,rgba(0,0,0,0))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,0) 71%,#FFFFFF 71.1%,#FFFFFF 72%,rgba(0,0,0,0) 72.1%,rgba(0,0,0,0) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,0) 71%,#FFFFFF 71.1%,#FFFFFF 72%,rgba(0,0,0,0) 72.1%,rgba(0,0,0,0) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,0) 71%,#FFFFFF 71.1%,#FFFFFF 72%,rgba(0,0,0,0) 72.1%,rgba(0,0,0,0) 100%); /* IE10+ */
@kggayo
kggayo / flatten_array.cs
Last active October 12, 2017 05:59
C#: Flatten an array of arbitrarily nested arrays into a flat array.
/// <summary>
/// This program will flatten an array of arbitrarily nested arrays of integers into a flat array of integers. e.g. [[1,2,[3]],4] -> [1,2,3,4].
/// It will accept type in nested arrays and specify what type to return in a flatten array format.
/// </summary>
/// <param name="args"></param>
static void Main(string[] args)
{
//create an array of arbitrarily nested arrays
object[] nestedArrays = new object[] { 1,2,3,4, new Int32[]{2,3,4,5}, new object[]{ 6,7,8, new object[]{9,10,11}}, "A", "B", "C"};
@tim545
tim545 / lg-jquery-app-struct.md
Last active March 11, 2024 18:59
Structuring a large jQuery application

Structuring a large jQuery application

This document assumes you are building a traditional backend-heavy application as opposed to a frontend-heavy appliction which would typically use a framework like Angular or React. The use of these frameworks make this document irrelevant, however also require a change to your application architecture and a much larger overhead in order to get content onto a page, so as a simple way to build interactive web content a simple jquery based js stack will do fine.

Directory structure

It's important you use a directory structure which is impartial to your development environment, chosen server language (Python v. Java v. C# ...), and styling framwork (Twitter Bootstrap etc). This layer of separation means you can swap out the styles or the backend with minimal changes to the Js, simple and maintainable.

Here's an example from the project root: