Skip to content

Instantly share code, notes, and snippets.

View Worm4047's full-sized avatar
🎯
Focusing

Abhishek Chaudhary Worm4047

🎯
Focusing
View GitHub Profile
from flask import Flask, render_template
from flask_socketio import SocketIO, emit
app = Flask(__name__)
socketio = SocketIO(app)
values = {
'slider1': 25,
'slider2': 0,
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Synchronized Slider</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-3.3.1.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.1.1/socket.io.js"></script>
<script type="text/javascript">
$(document).ready(function() {
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Synchronized Slider</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-3.3.1.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.1.1/socket.io.js"></script>
</head>
<body>
from flask import Flask, render_template
from flask_socketio import SocketIO, emit
# Creating a flask app and using it to instantiate a socket object
app = Flask(__name__)
socketio = SocketIO(app)
# values['slider1'] and values['slider2'] store the current value of the sliders
# This is done to prevent data loss on page reload by client.
values = {
@Worm4047
Worm4047 / style.css
Created September 2, 2017 11:52
PIXEL ART MAKER
body {
text-align: center;
font-family: 'Inconsolata', monospace;
}
h1 {
font-family: 'Luckiest Guy', cursive;
font-size: 70px;
margin: 0.2em;
}
@Worm4047
Worm4047 / design.js
Created September 2, 2017 11:51
PIXEL ART MAKER
//Variable to store number of rows, column of table and input color
var input_rows;
var input_cols;
var input_color = "#000000";
//Make Grid function
function makeGrid() {
var table = document.getElementById("pixel_canvas");
//Clearing the table
while(table.rows.length > 0)
@Worm4047
Worm4047 / index.html
Last active September 2, 2017 11:42
PIXEL ART MAKER
<!DOCTYPE html>
<html>
<head>
<title>Pixel Art Maker!</title>
</head>
<body>
<h1>Pixel Art Maker</h1>
<h2>Choose Grid Size</h2>
<form id="sizePicker">
<label>Grid Height: