Skip to content

Instantly share code, notes, and snippets.

View pixelspencil's full-sized avatar
🧠
Learning

PixelsPencil pixelspencil

🧠
Learning
View GitHub Profile
@pixelspencil
pixelspencil / input.scss
Created January 6, 2021 21:23
Generated by SassMeister.com.
$width-sm: 400px;
$width-md: 1000px;
$width-lg: 1600px;
@mixin breakpoint($mq) {
@if $mq == small {
@media (min-width: $width-sm) { @content }
}
@else if $mq == medium {
@media (min-width: $width-md) { @content }
@pixelspencil
pixelspencil / colours.scss
Last active July 7, 2020 08:19
SASS Template
/* Colors */
/* http://chir.ag/projects/name-that-color */
$lime: #b0eb00;
$bright-red: #b30015;
$dark-blue: #2a00b3;
$deep-cerulean: #0077b3;
$bondi-blue: #00b0b3;
$cyan: #24fbff;
$heliotrope: #8a7dff;
$silver-chalice: #a6a6a6;
// ----------------------------------------------------
// absolute positioning
// ----------------------------------------------------
// Although it’s not particularly hard to absolutely
// position an element with CSS, you can save a lot of
// time with this mixin. It allows you to quickly
// specify values for the four directions:
// top, right, bottom, and left.
@pixelspencil
pixelspencil / hex-alpha.css
Last active March 23, 2021 00:33
CSS Snippets
```css
selector {
color: #000000;
background: #ffffff77
}
```
/*
- Instead of using rgba() you can use #00000078, the last two digits are the alpha value 00-ff
- [1 2 3 4 5 6 7 8 9 A B C D E F]
@pixelspencil
pixelspencil / web-servers.md
Created April 29, 2020 17:00 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@pixelspencil
pixelspencil / js-element-node-counter.js
Last active March 23, 2021 00:46
Script to count how many nodes are inside a parent element
// Function that runs and counts children inside a parent
function getCount(parent, getChildrensChildren){
var relevantChildren = 0;
var children = parent.childNodes.length;
for(var i=0; i < children; i++){
if(parent.childNodes[i].nodeType != 3){
if(getChildrensChildren)
relevantChildren += getCount(parent.childNodes[i],true);
relevantChildren++;
}