Skip to content

Instantly share code, notes, and snippets.

View senadir's full-sized avatar

Seghir Nadir senadir

View GitHub Profile
@senadir
senadir / 0_reuse_code.js
Created June 6, 2014 00:20
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC/dA6eNmbxiJhEZPXLwX8u1dNp20hGaGueo1mPcg2T9mvgfJe0zImlo1YzFk9+tVcoKrT8P4HgIFF2IKzeNec4LTji3eegSDrQsWbqr7r4bWHIPh+BtsV5JHcLU0YaqaBWwYRuQzhaB0EetomWYT4irD/ETPPeyvYNLfuEEbLwqHKaGpg3tm7Gfrtf3a+PXgTbM39mW2NBjh7+Pcl3+GfqXaQZMpx1SDXuVpLBpgg4ui9ddRBEoezukvKmgEtpbkBb0VQdVK7n8W4ay6z9HLW/Pw68FoZjXWIBlJtnkPfyFrmU17Wji+XnWo+/Dlpe9rPRXmTXma3uJBgxkWnNoBR0IsEjpRrYJSyjnXSmqRQ+ZTTysi3E3ls3PtXG9ofl1OTPGDLnuxualWV5Ni9fPUwYEFClOPZ6dHrqxfbGur2vvef+q7RdQvz8zLGB2aMJMCQ5H6NJp2T/hy9yCmnxpvM9QL7JNIdtOI7hinRr7mv2Nvks8IlyCnyiLOZkBVn7tywL4A7DEXK2DdZgHABHmspCsrm7fB4nuKTRs0tu81cdA7sjcTenjUws4aPrk5G7Plhu1rNhOYx7U4y5aTd5T84mA24RDTx+kx/W4r+K8eFzxqSfR8G1zDpe416bYbNoptNR+LShQISk8L7xsCJ7TF3JR3kLAp/vRmaSxaI4ojTggw== nadir.seghir@gmail.com
@senadir
senadir / dot-drag-area.js
Last active September 13, 2019 16:16
Basic Drag Block
/**
* External dependencies
*/
import { useDrop } from 'react-dnd';
/**
* Internal dependencies
*/
import Dot from './dot';
function DotDragArea( { dots, setDots, children } ) {
@senadir
senadir / docker-compose.yml
Created November 13, 2019 10:27
my docker-compose file
version: '2'
services:
wordpress:
image: wordpress
ports:
- 8889:80
environment:
WORDPRESS_DEBUG: 1
--- a/assets/js/blocks/cart-checkout/cart/full-cart/cart-line-item-row.js
+++ b/assets/js/blocks/cart-checkout/cart/full-cart/cart-line-item-row.js
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
-import { RawHTML } from '@wordpress/element';
+import { RawHTML, useState, useEffect } from '@wordpress/element';
import { __, sprintf } from '@wordpress/i18n';
import PropTypes from 'prop-types';
{
"active-filters-frontend.js": [
[ "react-dom", 36702, "35.84 KB" ],
[ "wp-polyfill", 33765, "32.97 KB" ],
[ "lodash", 24343, "23.77 KB" ],
[ "wp-data", 8654, "8.45 KB" ],
[ "wc-blocks-data-store", 7080, "6.91 KB" ],
[ "wp-compose", 6699, "6.54 KB" ],
[ "react", 5177, "5.06 KB" ],
[ "wp-url", 4679, "4.57 KB" ],
const fs = require('fs').promises;
const { readFileSync } = require('fs');
const gzipSize = require('gzip-size');
const { filesize } = require('humanize');
const wpDeps = require('./wp-deps.json');
const filesFolder = './files'
const handleExternal = (dep, ext) => {
const wcHandleMap = {
'polyfill': 'wp-polyfill',
@import url( 'https://fonts.googleapis.com/css2?family=Source+Sans+Pro&display=swap' );
body {
width: 100vw;
height: 100vh;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
font-family: 'Source Sans Pro', sans-serif;
}
// only frontend block files
const b25 = require('./2.5.size-gzip.json').results;
const b26 = require('./2.6.size-gzip.json').results;
// all files.
const b25All = require('./blocks-2.5-all.json').results;
const b26All = require('./blocks-2.6-all.json').results;
const bytes = require('bytes');
const tablemark = require('tablemark')
[
{
"title": "The One Where Monica Gets a Roommate (Pilot)",
"number": "1",
"image": "https://occ-0-784-778.1.nflxso.net/dnm/api/v6/9pS1daC2n6UGc3dUogvWIPMR_OU/AAAABYNxZy-KPW08N_V_2cnzjfvZS5IoQwEq8UlA1afJW0kqOp4J6I6L0uEQtPQlW147Vi9vE3u5jBGuU_CxWcXKrdFZGf-3AYUMuiiBOHVFMIQ0MuFi.webp?r=42d",
"plot": "Rachel runs from her wedding and meets the friends in the coffee place. Ross is depressed about his divorce but he still has a crush on Rachel.",
"link": "https://www.netflix.com/watch/70273997",
"season": "1"
},
{