Skip to content

Instantly share code, notes, and snippets.

View laerciobernardo's full-sized avatar
🏠
Working from home

Laércio Bernardo laerciobernardo

🏠
Working from home
  • iUPi Tecnologia
  • Vila Nova de Gaia, Porto
  • 15:00 (UTC +01:00)
  • X @laerciobernardo
View GitHub Profile
1 - Após o acesso SSH na instância da amazon efetue atualize os pacotes da distribuição
$ sudo apt-get update
$ sudo apt-get upgrade
2 - Instalar o APACHE
$ sudo apt-get install apache2 -y
3 - Instalar o MySQL
$ sudo apt-get install mysql-server mysql-client -y
$stmt = $dbh->prepare('
SELECT
*
FROM
table
ORDER BY
name
LIMIT
:limit
OFFSET
@laerciobernardo
laerciobernardo / app.js
Last active May 24, 2017 14:44
Setup Openshift to run localhost and online
'use strict'
const express = require('express');
const bodyParser = require('body-parser');
const path = require('path');
const app = express();
//Handler to provider any function to parse in ObjectId
String.prototype.toObjectId = function() {
var ObjectId = (require('mongoose').Types.ObjectId);
return new ObjectId(this.toString());
@laerciobernardo
laerciobernardo / hexIEEEtoFloat.js
Last active January 21, 2024 14:48
Convert Hexadecimal IEEE754 to Float in Javascript
var str = '0x41FC6733';
function parseFloat(str) {
var float = 0, sign, order, mantiss,exp,
int = 0, multi = 1;
if (/^0x/.exec(str)) {
int = parseInt(str,16);
}else{
for (var i = str.length -1; i >=0; i -= 1) {
if (str.charCodeAt(i)>255) {