Skip to content

Instantly share code, notes, and snippets.

View mcabreradev's full-sized avatar
🎯
Focusing

Miguelángel Cabrera mcabreradev

🎯
Focusing
View GitHub Profile
@mcabreradev
mcabreradev / tablapaises.sql
Created September 28, 2020 04:21 — forked from angeldelrio/tablapaises.sql
Tabla MySQL paises el mundo en español
CREATE TABLE `paises` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`iso` char(2) DEFAULT NULL,
`nombre` varchar(80) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
INSERT INTO `paises` VALUES(1, 'AF', 'Afganistán');
INSERT INTO `paises` VALUES(2, 'AX', 'Islas Gland');
INSERT INTO `paises` VALUES(3, 'AL', 'Albania');
// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
javascript: (function() {
var styleEl = document.getElementById('css-layout-hack');
if (styleEl) {
styleEl.remove();
return;
}
styleEl = document.createElement('style');
styleEl.id = 'css-layout-hack';
@mcabreradev
mcabreradev / tmux-cheatsheet.markdown
Created December 11, 2018 20:39 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@mcabreradev
mcabreradev / ng-image-onload.js
Created May 6, 2017 03:36 — forked from kmaida/ng-image-onload.js
AngularJS image onload directive
app.module['myApp'].directive('imageOnload', function() {
return {
restrict: 'A',
link: function(scope, element, attrs) {
element.bind('load', function() {
// call the function that was passed
scope.$apply(attrs.imageOnload);
// usage: <img ng-src="src" image-onload="imgLoadedCallback()" />
});
@mcabreradev
mcabreradev / angularjs_directive_attribute_explanation.md
Created February 23, 2017 17:41 — forked from CMCDragonkai/angularjs_directive_attribute_explanation.md
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
@mcabreradev
mcabreradev / image-embed-html.php
Created September 27, 2016 16:08 — forked from jasny/image-embed-html.php
Create base64 encoded image to embed in HTML
<?php
$files = array_slice($argv, 1);
foreach ($files as $file) {
$picture = file_get_contents($file);
$size = getimagesize($file);
// base64 encode the binary data, then break it into chunks according to RFC 2045 semantics
$base64 = chunk_split(base64_encode($picture));
@mcabreradev
mcabreradev / export-syntax.js
Created September 23, 2016 20:36 — forked from caridy/export-syntax.js
ES6 Module Syntax Table
// default exports
export default 42;
export default {};
export default [];
export default foo;
export default function () {}
export default class {}
export default function foo () {}
export default class foo {}
@mcabreradev
mcabreradev / post.md
Last active August 29, 2015 14:25 — forked from kbond/post.md

Install git:

sudo apt-get install git

Configure Git:

touch ~/.gitignore_global
git config --global core.excludesfile ~/.gitignore_global
git config --global user.name "Your Name"

git config --global user.email "Your Email"

# Atom Cheatsheet.
# Project Key Bindings.
- 'cmd-shift-p': open the command palette.
- 'cmd-p' or 'cmd-t': open the fuzzy finder to find a file.
- 'cmd-b': look for a file that is already open.
- 'cmd-shift-b': search the list of files modified and untracked in your project repository.
- 'ctrl-0': open and focus the the tree view.
#############################################
# Push de la rama actual
git push origin $rama_actual
#############################################
# Volver a un commit anterior, descartando los cambios
git reset --HARD $SHA1
#############################################
# Ver y descargar Ramas remotas