A Pen by Celina Uemura on CodePen.
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
/* example: | |
console.time('sleep'); | |
await sleep(3000); | |
console.timeEnd('sleep'); | |
*/ | |
export const sleep = async (timer) => new Promise((resolve) => { | |
setTimeout(() => resolve("done"), timer); | |
}); |
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
class TextSized extends StatelessWidget { | |
const TextSized({Key key}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
final String text = "Text in one line"; | |
final TextStyle textStyle = TextStyle( | |
fontSize: 30, | |
color: Colors.white, | |
); |
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 data = "\\u00e3o\\u00e9\\u00e7\\u00e9\\u00e2\\u00e3o\\u00e7\\u00e3\\u00e0\\u00e3"; | |
function convertData(data) { | |
let hexDecode = (str) => { | |
let j; | |
let hexes = str.match(/.{1,4}/g) || []; | |
let back = ""; | |
for(j = 0; j<hexes.length; j++) { | |
back += String.fromCharCode(parseInt(hexes[j], 16)); | |
} |
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
'use strict' | |
const _ = require('lodash'); | |
const request = require('request'); | |
const Q = require('q'); | |
Q.allSettled(_.map(["http://127.0.0.1", "http://www.test.com"], (url) => Q.nfcall(request.get, url))) | |
.then(results => { | |
for (let result of results) { |
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
{ | |
"query": { | |
"bool": { | |
"must": [ | |
{ | |
"match": { | |
"valid": "false" | |
} | |
}, | |
{ |
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
// calculate century of year | |
// usage: calcCentury(1500) | |
function calcCentury(year) { | |
var cent = (year - (year%100)) /100; | |
if (year%100 > 0) { sec++; } | |
return cent; | |
} |
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 gulp = require('gulp'); | |
var browserSync = require('browser-sync'); | |
var compass = require('gulp-compass'); | |
var reload = browserSync.reload; | |
// Start the server | |
gulp.task('browser-sync', function() { | |
browserSync({ | |
server: { | |
baseDir: "./" |
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 replaceSprite(selector){ | |
var $selector = $(selector); | |
var back_position = $selector.css('background-position'); | |
if (navigator.userAgent.search("MSIE") >= 0) { | |
var back_x = $selector.css('background-position-x'), | |
back_y = $selector.css('background-position-y'), | |
back_position = back_x+" "+back_y; | |
} |
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 url(http://fonts.googleapis.com/css?family=Amaranth:400,700); | |
body { background-color: #DDDDDD; font: 30px 'Amaranth', sans-serif; } | |
#widget-cezinha{ | |
background:#efefef; | |
-moz-border-radius: 0.25em; | |
border-radius: 0.25em; | |
padding:10px 5px 5px 5px; | |
} | |
#widget-cezinha h3{margin:0;padding:5px 10px;clear:both;overflow:hidden} | |
#widget-cezinha h3 a{font-size:14px;text-decoration:none;} |