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
<html> | |
<head> | |
<style> | |
.modal { | |
display: none; | |
} | |
.modal-open { | |
display: block; | |
} |
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
mkcd () { mkdir -p "$1" && cd "$1"; } |
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
ffmpeg -r 1000/100 -f image2 -i img-%d.png -i ov.gif -filter_complex "[0:v][1:v]overlay=0:0" out.gif | |
// -r 1000 / fps | |
// -f image2 = list of image inputs matching the pattern |
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 explodeGif(gifUrl) { | |
return gifler(gifUrl)._animatorPromise.then(function(gif) { | |
let current = createTempCanvas(gif.width, gif.height, 'current'); | |
let currentCtx = current.getContext('2d'); | |
let temp = createTempCanvas(gif.width, gif.height, 'temp'); | |
let tempCtx = temp.getContext('2d'); | |
gif._animationLength = 0; | |
for (let i = 0; i < gif._frames.length; i++) { |
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
<html> | |
<body> | |
<script> | |
let fps = 15; | |
let now, then = Date.now(); | |
let first = then; | |
let interval = 1000 / fps; // 1000ms (1s) / fps | |
let diff, counter = 0; | |
(function draw() { |
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
let animal = { | |
init: function(name, age) { | |
this.name = name; | |
this.age = age; | |
return this; | |
}, | |
getName: function() { | |
return this.name; | |
}, | |
getAge: function() { |
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
let img = new Image(); | |
img.onload = function() { | |
let canvas = document.createElement('canvas'); | |
let ctx = canvas.getContext('2d'); | |
canvas.width = img.width; | |
canvas.height = img.height; | |
canvas.width = img.height; | |
canvas.height = img.width; |
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
<html> | |
<body> | |
<!-- Add a placeholder for the Twitch embed --> | |
<div id="twitch-embed"></div> | |
<!-- Load the Twitch embed script --> | |
<script src="https://embed.twitch.tv/embed/v1.js"></script> | |
<!-- Create a Twitch.Embed object that will render within the "twitch-embed" root element. --> | |
<script type="text/javascript"> |
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 User: | |
role = 'user' | |
def __init__(self, name): | |
self.name = name | |
def get_name(self): | |
print(self.name) | |
@classmethod |
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 json | |
obj = json.loads('{"msg_id":"07kg0Z1uAQMmLN6lM","_text":"i want links to racing and horses","entities":{"links_category":[{"suggested":true,"confidence":0.97013993755778,"value":"racing","type":"value"},{"suggested":true,"confidence":0.94886424860786,"value":"horses","type":"value"}]}}') | |
entities = obj['entities'] | |
intents = [] | |
for key in entities: | |
aux = [] | |
for entity in entities[key]: |