Skip to content

Instantly share code, notes, and snippets.

View dmoralesm's full-sized avatar

David Morales dmoralesm

View GitHub Profile
@dmoralesm
dmoralesm / index.html
Created February 25, 2017 00:16
Array.unique implementation (http://jsbench.github.io/#723899c9fd4dba58575b03f2177c172b) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Array.unique implementation</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@dmoralesm
dmoralesm / reset.wcsadmin.sql
Created March 26, 2014 01:12
Resetting the wcsadmin user password (Developer)
update userreg set logonpassword = x'74434f61354f51593862415655304d5268424e54723865685653356151374a2b353163506c4261363730633d202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020' where logonid='wcsadmin';
update userreg set salt = 'hsdbacehyoyn' where logonid='wcsadmin';
update userreg set status = 1 where logonid='wcsadmin';
update userreg set passwordexpired = 0 where logonid='wcsadmin';
@dmoralesm
dmoralesm / gist:6987776
Last active December 25, 2015 13:59
Get remote file size using php.
<?php
function getRemoteFileSize($url) {
$info = get_headers($url,1);
if (is_array($info['Content-Length'])) {
$info = end($info['Content-Length']);
}
else {
$info = $info['Content-Length'];
}
@dmoralesm
dmoralesm / gist:6987725
Created October 15, 2013 07:12
Reset Magento's admin password.
UPDATE admin_user SET password=CONCAT(MD5('qXnewpassword'), ':qX') WHERE username='admin';