Skip to content

Instantly share code, notes, and snippets.

View alephart's full-sized avatar
馃彔
Working from home

Juan Carlos Pulido S alephart

馃彔
Working from home
View GitHub Profile
@alephart
alephart / .hyper.js
Last active December 11, 2018 01:40
Config Hyper with opacity in windows (with git bash)
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
@alephart
alephart / slugify.js
Last active August 29, 2018 04:08
Slugify es la acci贸n de pasar una cadena de texto a una URL valida (un slug, como en wordpress). Aqu铆 un funci贸n Javascript para esta acci贸n.
// Slugify a string
// taken from https://www.lucidar.me/en/web-dev/how-to-slugify-a-string-in-javascript/
function slugify(str)
{
str = str.replace(/^\s+|\s+$/g, '');
// Make the string lowercase
str = str.toLowerCase();
@alephart
alephart / slugify.php
Last active August 29, 2018 04:09
Slugify es la acci贸n de pasar una cadena de texto a una URL valida (un slug, como en wordpress). Aqu铆 un funci贸n PHP para esta acci贸n.
// Slugify a string
// taken from https://www.lucidar.me/en/web-dev/how-to-slugify-a-string-in-php/
function slugify($text)
{
// Strip html tags
$text=strip_tags($text);
// Replace non letter or digits by -
$text = preg_replace('~[^\pL\d]+~u', '-', $text);
// Transliterate
setlocale(LC_ALL, 'en_US.utf8');
@alephart
alephart / main.js
Created July 5, 2016 04:36
Meteor con Blaze
import { Template } from 'meteor/templating';
import { ReactiveVar } from 'meteor/reactive-var';
import './main.html';
Template.hello.onCreated(function helloOnCreated() {
// counter starts at 0
this.counter = new ReactiveVar(0);
});
@alephart
alephart / main.jsx
Last active July 5, 2016 04:37
Meteor con React
import React from 'react';
import { Meteor } from 'meteor/meteor';
import { render } from 'react-dom';
class Counter extends React.Component {
constructor(props) {
super(props);
this.state = {count: props.initialCount};
this.tick = this.tick.bind(this);
}