Created by Christopher Manning
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 num = 20; // Число картинок | |
var wrap = 400; // Размер "холста" для расположения картинок | |
var radius = 200; // Радиус нашего круга | |
$(document).ready(function() { | |
for (i=0;i<num; i++){ | |
var f = 2 / num * i * Math.PI; // Рассчитываем угол каждой картинки в радианах | |
var left = wrap + radius * Math.sin(f) + 'px'; | |
var top = wrap + radius * Math.cos(f) + 'px'; | |
$('#wrap img').eq(i).css({'top':top,'left':left}); // Устанавливаем значения каждой картинке |
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
.spectrum-background { | |
background: | |
linear-gradient(red, transparent), | |
linear-gradient(to top left, lime, transparent), | |
linear-gradient(to top right, blue, transparent); | |
background-blend-mode: screen; | |
} | |
.plaid-background { | |
background: |
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
#app | |
.row | |
.col-3 | |
.mb-2 | |
button.btn.btn-primary(@click="collapseAll") collapse all | |
button.btn.btn-primary.ml-1(@click="expandAll") expand all | |
Tree(:data="tree1data" draggable cross-tree) | |
div(slot-scope="{data, store}") | |
template(v-if="!data.isDragPlaceHolder") | |
b(v-if="data.children && data.children.length" @click="store.toggleOpen(data)") {{data.open ? '-' : '+'}} |
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
<script type="x-shader/x-vertex" id="vertexMetaballs"> | |
attribute vec2 position; | |
void main() { | |
gl_Position = vec4(position, 0.0, 1.0); | |
} | |
</script> | |
<script type="x-shader/x-fragment" id="fragmentMetaballs"> | |
precision highp float; | |
const int NUM_METABALLS = 15; |
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
/* | |
Copy this into the console of any web page that is interactive and doesn't | |
do hard reloads. You will hear your DOM changes as different pitches of | |
audio. | |
I have found this interesting for debugging, but also fun to hear web pages | |
render like UIs do in movies. | |
*/ | |
const audioCtx = new (window.AudioContext || window.webkitAudioContext)() |
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
<!DOCTYPE html> | |
<html lang="en" dir="ltr"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Concept Chat</title> | |
<link rel="stylesheet" href="index.css" > | |
</head> | |
<body> |
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 obj = {name:"test", result:"hello world"}; | |
var string = JSON.stringify(obj); | |
console.log(obj) | |
var arr = []; | |
encode = Array.from(string); | |
while(encode.length>0){ | |
arr.push(encode.shift().charCodeAt(0)); | |
} | |
var u16 = new Uint16Array(arr); | |
var blob = new Blob([u16], {type:'application/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
// rename gist |
OlderNewer