This is a curated set of conventions and best practices for Stylus, an expressive, dynamic, robust and advanced CSS preprocessor. Frustrated with there not being a set of conventions set in place (that could be easily found), I set forth to find out on my own.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var Sequelize = require("sequelize") | |
| var sequelize = new Sequelize('database', 'root') | |
| var User = sequelize.define('User', { username: Sequelize.STRING }) | |
| var Comment = sequelize.define('Comment', { text: Sequelize.TEXT }) | |
| User.hasMany(Comment) | |
| Comment.belongsTo(User) | |
| sequelize.sync({force: true}).success(function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| javascript: | |
| var minimap = document.body.cloneNode(true); | |
| [].forEach.call(minimap.getElementsByTagName('a'), function(link) { | |
| link.href = 'javascript:;'; | |
| }); | |
| minimap.style.position = 'fixed'; | |
| minimap.style.webkitTransform = 'scale(.1)'; | |
| document.body.appendChild(minimap); | |
| minimap.style.top = minimap.offsetHeight*-.45+'px'; | |
| minimap.style.right = minimap.offsetWidth*-.45+'px'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ... | |
| #import "RCTLog.h" | |
| ... | |
| - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
| { | |
| RCTSetLogThreshold(RCTLogLevelInfo); | |
| ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const repl = require('repl'); | |
| const babel = require('babel-core'); | |
| function preprocess(input) { | |
| const awaitMatcher = /^(?:\s*(?:(?:let|var|const)\s)?\s*([^=]+)=\s*|^\s*)(await\s[\s\S]*)/; | |
| const asyncWrapper = (code, binder) => { | |
| let assign = binder ? `global.${binder} = ` : ''; | |
| return `(function(){ async function _wrap() { return ${assign}${code} } return _wrap();})()`; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| ###################################################################################### | |
| # regex for iterm2: | |
| # chrome-devtools\:\/\/devtools\/remote\/serve\_file\/\@[a-f0-9]*\/inspector\.html\?experiments\=true\&v8only\=true\&ws\=localhost\:9229\/[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12} | |
| # | |
| # command for iterm2: | |
| # /path/to/script/chrome-devtools-refresh.sh "\0" [-h "example.com"] | |
| ###################################################################################### |
layout.jade
doctype 5
html.no-js(lang='en')
block vars
head
title #{title}
meta(name='description', content='#{description}')
body
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* normal flexbox */ | |
| .flexbox .flex-container { | |
| display: -webkit-flex; | |
| display: -moz-flex; | |
| display: -ms-flex; | |
| display: flex; | |
| } | |
| .flexbox .flex-container.vertical { | |
| display: -webkit-flex; | |
| display: -moz-flex; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function getBase64FromImage(url, onSuccess, onError) { | |
| var xhr = new XMLHttpRequest(); | |
| xhr.responseType = "arraybuffer"; | |
| xhr.open("GET", url); | |
| xhr.onload = function () { | |
| var base64, binary, bytes, mediaType; | |
| bytes = new Uint8Array(xhr.response); |
OlderNewer