Skip to content

Instantly share code, notes, and snippets.

View earthwormjimjones's full-sized avatar

Earthwormjimjones earthwormjimjones

View GitHub Profile
@dhunmoon
dhunmoon / jsCSVFileCreationBlob.js
Created March 22, 2017 09:57
JS: CSV File Creation Using BLOB
function exportToCsv(filename, rows) {
var processRow = function (row) {
var finalVal = '';
for (var j = 0; j < row.length; j++) {
var innerValue = row[j] === null ? '' : row[j].toString();
if (row[j] instanceof Date) {
innerValue = row[j].toLocaleString();
};
var result = innerValue.replace(/"/g, '""');
if (result.search(/("|,|\n)/g) >= 0)
@cferdinandi
cferdinandi / metabox-single.php
Last active March 15, 2023 01:33
Create a metabox with a single field
<?php
/**
* Create a metabox with a single field.
* Replace `_namespace` with some namespace for your project to avoid conflicts with other items
*/
//
// Create Metabox
//
@davidhund
davidhund / comments.css
Created October 18, 2016 10:00
Example of various CSS comment styles
/**
* = MAIN Comment Block
*
* A Main Comment Block for a file. Recognized by the
* 'heavy' bottom border. This comment lives at the top of a file and
* document's its function.
*
* ========================================================================= */
@letanure
letanure / bootstrap-all-elements.html
Created June 14, 2016 10:07
List of all bootstrap components
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bootstrap all elements</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
@veganista
veganista / file.liquid
Created April 20, 2016 10:56
Debugging Objects in Shopify Templates
<script>console.log({{ product | json }});</script>
@gokulkrishh
gokulkrishh / media-query.css
Last active March 18, 2025 03:44
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@MWins
MWins / CSS-Best Practices.md
Last active September 7, 2024 04:41
CSS best practices

What CSS best practices should I follow ?

HTML best practices Depends. How far down the rabbit hole do you want to go ?

Just need something to look good : use a frontend framework like foundation or bootstrap, won't learn much about CSS. Short list of Front End Frameworks

Surface level : work general to specific. Comment the sections of the CSS. Use a reset or normalizer. Work on patterns, use classes over IDs for reuse. CSS Resets - includes normalize.css Don't have links for the other parts. see below

Little bit deeper : Look into BEM or OOCSS. Those stand for Block Element Modifier and Object Oriented CSS. Two popular methodologies for CSS. Also SMACSS.

@bobbygrace
bobbygrace / trello-css-guide.md
Last active December 10, 2024 21:04
Trello CSS Guide

Hello, visitors! If you want an updated version of this styleguide in repo form with tons of real-life examples… check out Trellisheets! https://github.com/trello/trellisheets


Trello CSS Guide

“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”

You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?

@crucialfelix
crucialfelix / styles.less
Created October 27, 2014 09:33
Highlight active pane, active tab in Atom.io
// active pane
.pane {
.gutter,
ul.tab-bar {
opacity: 0.4;
}
}
.pane.active {
.gutter {
opacity: 1;
@whizark
whizark / class-naming-convention.md
Last active December 2, 2024 03:03
HTML/CSS Class Naming Convention #html #css #sass