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
export let supportsPassive = false | |
if (typeof window !== 'undefined') { | |
supportsPassive = false | |
try { | |
var options = Object.defineProperty({}, 'passive', { | |
get () { | |
supportsPassive = true | |
}, | |
}) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
> 1% | |
last 5 versions | |
not ie <= 8 |
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 fs = require('fs') | |
const path = require('path') | |
const ora = require('ora') | |
const chalk = require('chalk') | |
const mkdirp = require('mkdirp') | |
const globby = require('globby') | |
const archiver = require('archiver') | |
const clear = require('clear') | |
const pkg = require('./package.json') |
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
module.exports = function () { | |
// | |
// [ express middleware ] | |
// Generate a /fake/images route for testing images source | |
// | |
// images service origin: | |
// - PICSUM(https://picsum.photos) | |
// Created by David Marby & Nijiko Yonskai | |
// Having trouble? Poke @DMarby on Twitter | |
// Images from unsplash |
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
<template> | |
<div class="photo-compared" :class="className" @mousedown="onPointDown" @touchstart="onPointDown"> | |
<div class="photo-compared__frame" :style="frameStyle"></div> | |
<div class="photo-compared__before" :style="beforeStyle"></div> | |
<div class="photo-compared__after" :style="afterStyle"></div> | |
<div class="photo-compared__handler" :style="handlerStyle"></div> | |
</div> | |
</template> | |
<script> |
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
package hi | |
import ( | |
"crypto/md5" | |
"encoding/base64" | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
"strconv" |
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 std::fs; | |
use std::io::{ Read, Write }; | |
use std::net::{ TcpListener, TcpStream}; | |
fn main() { | |
let server: TcpListener = TcpListener::bind("127.0.0.1:8080").unwrap(); | |
for stream in server.incoming() { | |
match stream { | |
Ok(mut stream) => { | |
router(stream) |
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 std::fmt; | |
// #[derive(Debug)] | |
struct Point<T> { | |
x: T, | |
y: T, | |
} | |
impl <T> fmt::Debug for Point<T> where T: fmt::Display { | |
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { |
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
extern crate rand; | |
use rand::prelude::*; | |
fn main() { | |
const LEN: usize = 10; | |
let mut arr: [i32; LEN] = [0; LEN]; | |
let mut rng = thread_rng(); | |
for index in 0..LEN { | |
arr[index] = rng.gen_range(0, 101) |