CLICK ME
yes, even hidden code blocks!
print("hello world!")
expect.extend({ | |
toContainObject(received, argument) { | |
const pass = this.equals(received, | |
expect.arrayContaining([ | |
expect.objectContaining(argument) | |
]) | |
) | |
if (pass) { |
source "https://rubygems.org" | |
gem "octokit" | |
gem "nokogiri" | |
gem "json" |
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works | |
const axios = require('axios'); // promised based requests - like fetch() | |
function getCoffee() { | |
return new Promise(resolve => { | |
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee | |
}); | |
} |
// the main app file | |
import express from "express"; | |
import loadDb from "./loadDb"; // dummy middleware to load db (sets request.db) | |
import authenticate from "./authentication"; // middleware for doing authentication | |
import permit from "./authorization"; // middleware for checking if user's role is permitted to make request | |
const app = express(), | |
api = express.Router(); | |
// first middleware will setup db connection |
// ---- | |
// Sass (v3.3.4) | |
// Compass (v1.0.0.alpha.18) | |
// ---- | |
// This code sucks. | |
.module-container { | |
background-color: red; |
@app = angular.module 'myApp', [] | |
@app.filter "nrFormat", -> | |
(number) -> | |
if number!=undefined | |
console.log number | |
abs = Math.abs(number) | |
if abs >= Math.pow(10, 12) | |
# trillion | |
number = (number / Math.pow(10, 12)).toFixed(1)+"t" | |
else if abs < Math.pow(10, 12) and abs >= Math.pow(10, 9) |
function string_to_slug (str) { | |
str = str.replace(/^\s+|\s+$/g, ''); // trim | |
str = str.toLowerCase(); | |
// remove accents, swap ñ for n, etc | |
var from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;"; | |
var to = "aaaaeeeeiiiioooouuuunc------"; | |
for (var i=0, l=from.length ; i<l ; i++) { | |
str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i)); | |
} |
// ==UserScript== | |
// @name <name> | |
// @match <URL patterns for activation> | |
// @description <description> | |
// ==/UserScript== | |
/** | |
* Outermost IIFE for bootstrapper. | |
* @param main Function encapsulating the real work of the script [required] | |
* @param dep_urls Array of URLs to dependencies [default: empty array] |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.