Skip to content

Instantly share code, notes, and snippets.

View darthzyklus's full-sized avatar

Andrés darthzyklus

View GitHub Profile
@darthzyklus
darthzyklus / custom_loop.php
Created February 23, 2019 16:05
custom query wordpress loop
<?php
$args = [
'post_type' => 'envio',
];
$query = new WP_Query($args);
?>
<section id="primary" class="content-area">
@darthzyklus
darthzyklus / example.storie.js
Created February 4, 2019 21:13
Story example
import React from "react";
import "reset-css";
import { storiesOf } from "@storybook/react";
import { action } from "@storybook/addon-actions";
import { linkTo } from "@storybook/addon-links";
import { Button, Welcome } from "@storybook/react/demo";
import Checkbox from "../components/Checkbox";
import Todo from "../components/Todo";
@darthzyklus
darthzyklus / App.jsx
Created February 3, 2019 04:04
progress bar example
import React from 'react';
import { render } from 'react-dom';
import ProgressBar from './ProgressBar';
const App = () => (
<div>
<ProgressBar title="HTML" value={2} />
<ProgressBar title="JavaScript" value={60} />
<ProgressBar title="React" value={80} />
</div>
@darthzyklus
darthzyklus / rfc.sublime-snippet
Last active December 26, 2018 17:34
React Functional Component Snippet
<snippet>
<content><![CDATA[
const ${1:${TM_FILENAME/(.+)\..+|.*/$1/:ComponentName}} = ${2:props} => (
${3:<div>
$4
</div>}
);
export ${5:default} $1;
]]></content >
@darthzyklus
darthzyklus / shadow-dom.md
Created October 14, 2018 13:44 — forked from praveenpuglia/shadow-dom.md
Everything you need to know about Shadow DOM

I am moving this gist to a github repo so more people can contribute to it. Also, it makes it easier for me to version control.

Please go to - https://github.com/praveenpuglia/shadow-dom-in-depth for latest version of this document. Also, if you find the document useful, please shower your love, go ⭐️ it. :)

Shadow DOM

Heads Up! It's all about the V1 Spec.

In a nutshell, Shadow DOM enables local scoping for HTML & CSS.

@darthzyklus
darthzyklus / benchmark-dom-classes.js
Created October 11, 2018 01:51 — forked from WebReflection/benchmark-dom-classes.js
Classes VS DOM Events Handling Benchmark
// Players
class ClickCounter {
constructor() { this.clicks = 0; }
onclick(e) { this.clicks += (e.type === 'click') ? 1 : -1; }
}
class Handler extends ClickCounter {
constructor(currentTarget) {
super();
currentTarget.addEventListener('click', this);
@darthzyklus
darthzyklus / 1.js
Created October 11, 2018 01:51 — forked from getify/1.js
creating hard-bound methods on classes
class Foo {
constructor(x) { this.foo = x; }
hello() { console.log(this.foo); }
}
class Bar extends Foo {
constructor(x) { super(x); this.bar = x * 100; }
world() { console.log(this.bar); }
}
server {
listen 80;
server_name blog.example.com;
root /var/www/blog.example.com;
index index.php;
#because default not define take account the protoccol of the proxie
fastcgi_cache_key $scheme$request_method$host$request_uri;
@darthzyklus
darthzyklus / telebot-command-with-args.js
Created September 25, 2018 00:51
Telebot command with arguments
bot.on(/^\/say (.+)$/, (msg, props) => {
const text = props.match[1];
return bot.sendMessage(msg.from.id, text, { replyToMessage: msg.message_id });
});