Skip to content

Instantly share code, notes, and snippets.

View sebastianrothbucher's full-sized avatar

Sebastian Rothbucher sebastianrothbucher

View GitHub Profile
@sebastianrothbucher
sebastianrothbucher / index.html
Created March 30, 2019 16:20
Responsive table brushed
<div>
<label><input name="variant" type="radio" value="flexwrap"> Flex wrap</label>
<label><input name="variant" type="radio" value="flexwraptwo"> Flex wrap II</label>
<label><input type="checkbox" id="checkfake" /> Fake mobile</label>
</div>
<div id="maindiv">
<div>
<table name="caniuse">
<thead>
<tr>
@sebastianrothbucher
sebastianrothbucher / json-handling.R
Created March 16, 2019 21:28
handling JSON in R for quick prototyping
# losely based on https://gist.github.com/gluc/5f780246d57897b57c6b
library(jsonlite)
reposLoL <- fromJSON("https://api.github.com/users/hadley/repos", simplifyDataFrame = FALSE)
reposDf <- data.frame(name=unlist(sapply(reposLoL, function(x) x$name)), url=unlist(sapply(reposLoL, function(x) x$url)))
reposDfAlt <- fromJSON("https://api.github.com/users/hadley/repos", simplifyDataFrame = TRUE)
@sebastianrothbucher
sebastianrothbucher / README.md
Created March 16, 2019 16:27
Vuejs guide as ebook (epub / Kindle)

This is how you can conver the vuejs guide to a .ePub / Kindle (.mobi) file to read in an eReader (or eReader app):

echo '' > toc
for i in *.md
do 
@sebastianrothbucher
sebastianrothbucher / README.md
Created March 16, 2019 16:12
Reactjs docs as ebook (epub / Kindle)

This is how you can conver the react docs to a .ePub / Kindle (.mobi) file to read in an eReader (or eReader app):

echo '' > ALL.md
for i in $(cat nav.yml | grep 'id:' | awk -F:  '{print$2}')
do
@sebastianrothbucher
sebastianrothbucher / index.html
Created February 3, 2019 16:48
waves-font-background
<div id="back">
whatever
<div id="fore"></div>
</div>
@sebastianrothbucher
sebastianrothbucher / howto.txt
Last active February 6, 2019 11:25
Magento (2.2) debug comments for layout
two patches
- AbstractBlock.php (toHtml)
- Layout.php (_renderContainer)
@sebastianrothbucher
sebastianrothbucher / shoppable_src.txt
Created November 4, 2018 17:54
Shoppable content WP - Magento
<!-- wp:paragraph -->
Now this is going to be cool: you can shop for hoodies right here:
<span id="testspan"></span>
<script language="JavaScript">
window.addEventListener('load', function() { // (need magrest defined as proxy); could easily use React et al to create sth and a one-line statement loading it
fetch('/magrest/V1/products-render-info?storeId=1&currencyCode=EUR&searchCriteria[filter_groups][0][filters][0][field]=entity_id&searchCriteria[filter_groups][0][filters][0][value]=2&searchCriteria[filter_groups][0][filters][0][condition_type]=eq').then(res => res.json()).then(res => {
var a_ = document.createElement('a');
a_.target='_blank';
@sebastianrothbucher
sebastianrothbucher / README.md
Last active October 31, 2018 19:07
Using db-migrate with Magento 2

Using db-migrate with Magento 2

Usage:

  1. Put all these files in magento/app/db (htaccess is in place then), go in that dir and npm install
  2. Create a new migration with a command à la export export DATABASE_URL=$(php dburl.php); node_modules/.bin/db-migrate create <<nameofmigration>> --sql-file
  3. Run main migration with npm run dbup or export DATABASE_URL="$(php dburl.php)?multipleStatements=true"; node_modules/.bin/db-migrate up
@sebastianrothbucher
sebastianrothbucher / index.html
Last active October 22, 2018 20:25
style HTML5 inputs
<div>
<label class="date">Date <input type="date" id="dateInput" /></label> <span class="supportHint" id="dateSupported"></span>
</div>
<div>
<datalist id="sugg"><option>one</option><option>two</option><option>three</option></datalist>
<label class="suggestions">Suggestions <input type="text" list="sugg"
onFocus="this.placeholder=(this.value||'');this.value=''"
onChange="this.placeholder=this.value"
onBlur="this.value=(this.placeholder||'')"