Skip to content

Instantly share code, notes, and snippets.

View andremalveira's full-sized avatar
:electron:
Learning Each Day

André Malveira andremalveira

:electron:
Learning Each Day
View GitHub Profile
@huzemin
huzemin / laravel-encrypt.js
Created December 3, 2019 06:47
laravel Encrypt convert to CryptoJS in Javascript
import CryptoJS from "crypto-js";
const LaravelEncrypt = function (key) {
this.key = key;
}
LaravelEncrypt.prototype.decrypt = function (encryptStr) {
encryptStr = CryptoJS.enc.Base64.parse(encryptStr);
let encryptData = encryptStr.toString(CryptoJS.enc.Utf8);
encryptData = JSON.parse(encryptData);
@jeffochoa
jeffochoa / Response.php
Last active November 13, 2024 14:18
Laravel HTTP status code
<?php
// This can be found in the Symfony\Component\HttpFoundation\Response class
const HTTP_CONTINUE = 100;
const HTTP_SWITCHING_PROTOCOLS = 101;
const HTTP_PROCESSING = 102; // RFC2518
const HTTP_OK = 200;
const HTTP_CREATED = 201;
const HTTP_ACCEPTED = 202;
@hotmeteor
hotmeteor / facebook
Last active December 5, 2022 20:30
Social media meta tag templates
<!-- Social: Facebook / Open Graph -->
<meta property="fb:admins" content="503386332">
<meta property="fb:app_id" content="1389892087910588">
<meta property="og:url" content="http://scotch.io/bar-talk/bootstrap-3-tips-and-tricks-you-might-not-know">
<meta property="og:type" content="article">
<meta property="og:title" content="Bootstrap 3 Tips and Tricks You Might Not Know">
<meta property="og:image" content="/wp-content/uploads/2014/05/bs31.jpg"/>
<meta property="og:description" content="Bootstrap 3 has a ton of features and helpers to speed up front-end development. Sometimes you need something and you end up writing your own custom CSS and JavaScript without even realizing that Bootstrap could have done it for you....">
<meta property="og:site_name" content="Scotch">
<meta property="article:author" content="https://www.facebook.com/NCerminara">
var myElement = document.getElementById('IDoftheDIV');
if(window.addEventListener) {
// Normal browsers
myElement.addEventListener('DOMSubtreeModified', contentChanged, false);
} else
if(window.attachEvent) {
// IE
myElement.attachEvent('DOMSubtreeModified', contentChanged);
}
@ricardobarantini
ricardobarantini / estados.php
Last active September 28, 2024 01:26
Array com nome e siglas de estados Brasileiros para select do Codeigniter
$estadosBrasileiros = array(
'AC'=>'Acre',
'AL'=>'Alagoas',
'AP'=>'Amapá',
'AM'=>'Amazonas',
'BA'=>'Bahia',
'CE'=>'Ceará',
'DF'=>'Distrito Federal',
'ES'=>'Espírito Santo',
'GO'=>'Goiás',
@ksafranski
ksafranski / Common-Currency.json
Last active November 15, 2024 10:05
Common Currency Codes in JSON
{
"USD": {
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
},
@lancejpollard
lancejpollard / meta-tags.md
Created March 5, 2012 13:54
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">
@marcosbrasil
marcosbrasil / image_map.html
Created November 29, 2011 19:15
Mapeamento de Imagens em HTML
<html>
<head>
<script type="text/javascript">
function coordenadas(event)
{
var x=event.clientX;
var y=event.clientY;
var coord = x + "," + y;
return coord;
}