Skip to content

Instantly share code, notes, and snippets.

@cfj
cfj / gist:9827429
Last active August 29, 2015 13:57
Makes console.logs blurry.
var log = console.log;
console.log = function(){
log.call(console, '%c' + [].slice.call(arguments).join(' '), 'color:transparent;text-shadow:0 0 2px rgba(0,0,0,.5);')
};
window.console.loge = function (msg) {
var gifs = ['wink','shake-space','peepers','prizza','hat','gradient','fat','rainbow','sunglasses','derp','shake'],
wow = ['', 'wow! ', 'amaze! ', 'dazzle! '],
adjs = ['so', 'such', 'many', 'much', 'very'],
randomizr = function (a) { return a[Math.floor(Math.random() * a.length)];},
message = '%c ' + randomizr(wow) + randomizr(adjs) + ' ' + typeof msg + ': ',
css = 'background-image: url(http://d1e3ezyatlol8u.cloudfront.net/img/212/doge-' + randomizr(gifs) + '-212.gif); background-size: 80px 80px; background-repeat: no-repeat; font-family: \'Comic Sans MS\', cursive; padding: 25px; line-height: 64px; color: white; font-weight: 800; width: 100%; display: block;';
console.log.apply(console, typeof msg === 'object' ? [message, css, msg] : [message += msg, css]);
};
@cfj
cfj / console.clog.js
Last active April 2, 2021 18:17
console.clog
window.console.clog = function(log){
var message = typeof log === 'object' ? '%cLooks like you\'re trying to log an ' : '%cLooks like you\'re trying to log a ',
style = 'background:url(http://i.imgur.com/SErVs5H.png);padding:5px 15px 142px 19px;line-height:280px;';
console.log.call(console, message + typeof log + '.', style);
};
@cfj
cfj / console.reverselog.js
Last active August 21, 2017 10:00
More console.log sillyness
var _log = console.log;
window.console.log = function(log){
_log.call(console, log.reverse ? log.reverse() : typeof log === 'string' ? log.split('').reverse().join('') : typeof log === 'number' ? log.toString().split('').reverse().join('') : typeof log === 'boolean' ? !log : log);
};
public static string GetOriginProof(int amount, string currency, string userToken)
{
var uuid = Guid.NewGuid().ToString();
JObject jsonObject = new JObject();
jsonObject["amount"] = amount;
jsonObject["currency"] = currency;
jsonObject["user_token"] = userToken;
jsonObject["id"] = uuid;
import { useState, useRef } from 'react';
import styles from '../styles/DebouncedInputFetchDemo.module.css';
const lookupOrder = async (orderNumber, fetchOptions = {}) => {
const response = await fetch(`/api/demo?orderNo=${orderNumber}&delay=3`, {
method: 'GET',
...fetchOptions
});
return response.json();