Skip to content

Instantly share code, notes, and snippets.

View visioncan's full-sized avatar
💭
I may be slow to respond.

VCAN visioncan

💭
I may be slow to respond.
View GitHub Profile
@addyosmani
addyosmani / README.md
Last active April 2, 2024 20:18 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@simonheys
simonheys / ArtboardsToXCAssets.jsx
Created September 25, 2014 14:30
Exports each Illustrator artboard as a PDF vector template in the selected XCode Images.xcassets folder
/*
ArtboardsToXCAssets.jsx
Exports each Illustrator artboard as a PDF vector template in the selected XCode Images.xcassets folder
Copyright (c) 2014 Simon Heys <http://www.simonheys.com/>
License: MIT License (MIT) <http://www.opensource.org/licenses/mit-license.php>
*/
var folder = Folder.selectDialog('Select Images.xcassets folder');
@LeaVerou
LeaVerou / RAINBOWlog.js
Created March 12, 2014 23:30
AWESOMEify your console.log()ing! Because life is too short to be black & white!!!!!!1111one
(function(){
var log = console.log;
console.log = function(str) {
var css = 'background: linear-gradient(to right, red, yellow, lime, aqua, blue, fuchsia, red); color: white; font-weight: bold;';
var args = Array.prototype.slice.call(arguments);
args[0] = '%c' + args[0];
args.splice(1,0,css);
return log.apply(console, args);
}
@jonathantneal
jonathantneal / README.md
Last active November 9, 2023 21:10
createElement.js // a 300 byte DOM Element creator

createElement.js

createElement.js lets document.createElement use CSS selectors.

This is a pretty useful library for building out DOM elements. The whole thing runs on one regex and a for loop, so it’s plenty fast. The script is 300 bytes when compressed and gzipped. For 524 bytes (advanced), it includes nesting support and can generate entire DOM hierarchies, including text nodes.

Usage

document.createElement(); // generates <div />
$bgcolor: hsl(53,56%,87%);
.button-primary {
background: $bgcolor;
color: if(lightness($bgcolor) < 50%, white, black);
}
@clochix
clochix / casperCookies.js
Created July 10, 2013 16:48
Sample cookies management with CasperJS: functions to load cookies from a Netscape formatted file and save them
/**
* Load cookies from a file
*
* @param {String} file name of da file.
*
* @return {Array} of cookies.
*/
function loadCookies(file) {
"use strict";
var cookies = [];
@apisit
apisit / gist:5893320
Created June 30, 2013 00:55
Remove that 1px line from UINavigationBar in iOS7
[self.navigationController.navigationBar.subviews enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
if ([obj isKindOfClass:NSClassFromString(@"_UINavigationBarBackground")]){
UIView* v = obj;
[[v.subviews objectAtIndex:1] removeFromSuperview];
*stop=YES;
}
}];
@hanksudo
hanksudo / Front-end-Developer-Interview-Questions-TC.md
Last active May 2, 2024 06:26
Front-end-Developer-Interview-Questions - 前端工程師面試問題集(繁體中文版)

前端工程師面試問題集

@版本 2.0.0

譯注:此翻譯版,主要給不能流利的讀英文的人看,相關專有名詞還是保留原文。翻譯不好地方請協助pull request.

此repository包含了一些前端開發的面試問題,來審查一個有潛力的面試者。這並不是建議你對同一個面試者問上所有的問 (那會花費好幾小時)。從列表中挑幾個題目,應該就夠幫助你審查面試者是否擁有你需要的技能。

Rebecca MurpheyBaseline For Front-End Developers 也是一篇很棒且值得讀的文章在你開始面試之前。

mymodule {
@at-root {
.#{&}-header { ... }
.#{&}-footer { ... }
.#{&}-body {
a { ... }
span { ... }
p { ... }
}
}