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 sendMessage(message){ | |
const mainEl = document.querySelector('#main') | |
const textareaEl = mainEl.querySelector('div[contenteditable="true"]') | |
if(!textareaEl) { | |
throw new Error('There is no opened conversation') | |
} | |
textareaEl.focus() | |
document.execCommand('insertText', false, message) |
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 slugify (str) { | |
str = str || '' | |
const a = 'àáäãâèéëêìíïîòóöõôùúüûñçßÿœæŕśńṕẃǵǹḿǘẍźḧ·/_,:;άαβγδεέζήηθιίϊΐκλμνξοόπρσςτυϋύΰφχψωώ' | |
const b = 'aaaaaeeeeiiiiooooouuuuncsyoarsnpwgnmuxzh------aavgdeeziitiiiiklmnxooprsstyyyyfhpoo' | |
const p = new RegExp(a.split('').join('|'), 'g') | |
return str.toString().trim().toLowerCase() | |
.replace(/ου/g, 'ou') | |
.replace(/ευ/g, 'eu') | |
.replace(/θ/g, 'th') |
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 interval, emojis | |
emojis = { | |
cachorro: '🐶', | |
gato: '🐱', | |
rato: '🐭', | |
rato: '🐹', | |
coelho: '🐰', | |
raposa: '🦊', | |
urso: '🐻', |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<noscript> | |
<meta http-equiv="refresh" content="0; URL=/noscript.html" /> | |
</noscript> | |
<title>Loading...</title> |
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
<select id="estado" name="estado"> | |
<option value="AC">Acre</option> | |
<option value="AL">Alagoas</option> | |
<option value="AP">Amapá</option> | |
<option value="AM">Amazonas</option> | |
<option value="BA">Bahia</option> | |
<option value="CE">Ceará</option> | |
<option value="DF">Distrito Federal</option> | |
<option value="ES">Espírito Santo</option> | |
<option value="GO">Goiás</option> |
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
// ==UserScript== | |
// @name Facebook Instant Block User | |
// @namespace http://tampermonkey.net/ | |
// @version 1.0.0 | |
// @description try to take over the world! | |
// @author You | |
// @match https://www.facebook.com* | |
// @grant none | |
// ==/UserScript== |
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
<?php | |
namespace App\Http\Controllers; | |
use PagSeguro; | |
use Carbon\Carbon; | |
use App\Transaction; | |
use Artistas\PagSeguro\PagSeguroException; | |
use Illuminate\Http\Request; |
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 'dart:mirrors'; | |
import 'dart:convert'; | |
class Encodable { | |
String toJson({List<String> only, List<String> except}) { | |
InstanceMirror myClassInstanceMirror = reflect(this); | |
ClassMirror myClassMirror = myClassInstanceMirror.type; | |
List<DeclarationMirror> dms = myClassMirror.declarations.values | |
.where((dm) => dm is VariableMirror && !dm.isStatic) |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width,initial-scale=1.0"> | |
<title>example-app</title> | |
<style> | |
html, | |
body { |
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
<?php | |
namespace App\Validator; | |
use Carbon\Carbon; | |
class CustomValidator extends \Illuminate\Validation\Validator { | |
protected function getTimePeriods($parameter) { | |
$keys = array_keys(trans('validation.time_periods')); | |
$values = array_values(trans('validation.time_periods')); |