type: PIN
Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys
type: PIN
Consumer key: IQKbtAYlXLripLGPWd0HUA
namespace :haml do | |
desc "Convert HAML templates to ERB" | |
task :convert_to_erb do | |
# Assumes you have faraday in your Gemfile | |
conn = Faraday.new(url: "https://haml2erb.org") do |f| | |
f.request :json | |
f.response :json | |
end | |
haml_filenames = Dir["app/views/**/*.haml"] |
const files = { | |
"m1.js": `import {func} from './m2.js'; console.log(func());`, | |
"m2.js": `export function func() { return 'abc'; }` | |
} | |
const urls = new Map | |
function getURL(filename) { | |
let url = urls.get(filename) | |
if (!url) { |
⤵
$ brew install pngquant
GitHub uses the following CSS font stack to display code:
font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace;
Chrome will use SFMono-Regular
when that font is installed locally, but Firefox will not. Workaround: Add the following CSS to your Firefox profile's userContent.css
file:
@font-face {
<!doctype html> | |
<html> | |
<head> | |
<title>Custom elements test</title> | |
</head> | |
<body> | |
<h3>Custom elements from HTML</h3> | |
<ol class="from-html" start="0"> |
This is the example webpack.config.js
on https://webpack.js.org/:
module.exports = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js'
}
}
getHexColor = (color) -> | |
return "" unless color | |
return color if /^#/.test(color) | |
rgbValues = getRGBValues(color) | |
hexValues = rgbValues.map(numberToHex) | |
"#" + hexValues.join("") | |
numberToHex = (number) -> | |
"0#{number.toString(16)}".slice(-2).toUpperCase() |
(async () => { | |
if (await mutionObserverIsBuggy()) { | |
patchInnerHTML() | |
} | |
})() | |
function mutionObserverIsBuggy(): Promise<boolean> { | |
return new Promise(resolve => { | |
const element = document.createElement("div") | |
element.innerHTML = "<a><em></em></a>" |
// direct_uploads.js
addEventListener("direct-upload:initialize", event => {
const { target, detail } = event
const { id, file } = detail