Skip to content

Instantly share code, notes, and snippets.

View aldomendez's full-sized avatar

Aldo Mendez Reyes aldomendez

  • NovaLink
  • Matamoros Tamaulipas Mexico
View GitHub Profile
@aldomendez
aldomendez / App.html
Last active March 22, 2018 13:37 — forked from anonymous/App.html
Svelte component
<h1>File reader API example</h1>
<p>taken from an example from <a href="https://alligator.io/vuejs/file-reader-component/"> alligator</a></p>
<textarea rows=5 bind:value="text"></textarea>
<FileReader on:load="set({'text':event.content})"/>
<InputText textvalue="{{textvalue}}" label="Dinamic Label" on:change="set({'textvalue':event.content})" />
<script>
import FileReader from './FileReader.html'
import InputText from './InputText.html'
@aldomendez
aldomendez / laravel-ums.markdown
Created February 28, 2018 19:45 — forked from anchetaWern/laravel-ums.markdown
Building a User Management System in Laravel

There's no shortage of good resources for learning laravel. So instead of the usual introductory tutorial were just gonna learn Laravel by building a project from scratch and that's gonna be a User Management System.

I don't know if my definition of a User Management System is correct but here's my idea of what's it's capable of doing:

  • Register Roles
  • Register Users
  • Update Users
@aldomendez
aldomendez / App.html
Created November 26, 2017 15:43 — forked from anonymous/App.html
Svelte component
<:Window on:click='seek(event)' on:mousemove='seek(event)'/>
<audio bind:currentTime='t' bind:duration='d' bind:paused>
<source type='audio/mp3' src='{{src}}'>
</audio>
<p>Via <a on:click='event.stopPropagation()' href='{{url}}'>SoundCloud</a></p>
<div class='status' on:click='event.stopPropagation()'>
<img alt="imege 1" on:click='set({ paused: !paused })' src='{{icon}}/333333'>
<span class='elapsed'>{{format(t)}}</span>
@aldomendez
aldomendez / node-and-npm-in-30-seconds.sh
Created November 6, 2017 22:08 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@aldomendez
aldomendez / criticalcss-bookmarklet-devtool-snippet.js
Created November 2, 2016 17:49 — forked from PaulKinlan/criticalcss-bookmarklet-devtool-snippet.js
CriticalCSS Bookmarklet and Devtool Snippet.js
(function() {
var CSSCriticalPath = function(w, d, opts) {
var opt = opts || {};
var css = {};
var pushCSS = function(r) {
if(!!css[r.selectorText] === false) css[r.selectorText] = {};
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/);
for(var i = 0; i < styles.length; i++) {
if(!!styles[i] === false) continue;
var pair = styles[i].split(": ");
@aldomendez
aldomendez / exec_orafn.js
Created October 18, 2016 11:19 — forked from isabolic/exec_orafn.js
node js execute oracle pl sql stored function on database
(function() {
var db = require('oracledb');
var plSQLFun = "begin " +
" :ret := pkb_demo.f_get_price(:p1); " +
"end; ";
var executeOnDb = function() {
var bindvars = {
ret: { dir: oracledb.BIND_OUT, type: oracledb.NUMBER },
p1: 'Y'
@aldomendez
aldomendez / README.md
Created October 14, 2016 11:26 — forked from addyosmani/README.md
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@aldomendez
aldomendez / html.cheat.sheet.md
Last active July 1, 2016 15:27
HTML sheat sheet

HTML Cheat Sheet

  • html, title, head, body tags are the bare bones of a web page, barebones example
<!DOCTYPE html>
@aldomendez
aldomendez / gist:c68b70a16a6711f4f1f575499e61f625
Created April 9, 2016 03:27 — forked from rmondello/gist:b933231b1fcc83a7db0b
Exporting (iCloud) Keychain and Safari credentials to a CSV file

Exporting (iCloud) Keychain and Safari credentials to a CSV file

After my dad died, I wanted to be able to have access any of his online accounts going forward. My dad was a Safari user and used iCloud Keychain to sync his credentials across his devices. I don’t want to have to keep an OS X user account around just to access his accounts, so I wanted to export his credentials to a portable file.

This is the process I used to create a CSV file of his credentials in the format “example.com,user,pass”. This portable format would be pretty easy to import into 1Password or Safari in the future.

The way I went about this isn’t great; it opens up more opportunities for apps to control one’s Mac through Accessibility APIs, it writes plaintext passwords to disk, and it could use some cleaning up. A better approach might leverage the security command line tool that ships with OS X. That said, I found this method to be a fun illustration of what’s possible us

<!DOCTYPE html>
<html>
<head>
<link href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.8/semantic.css" rel="stylesheet" type="text/css" />
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
.ui.card>.progress {
background:rgba(120, 202, 41, 1);