Skip to content

Instantly share code, notes, and snippets.

View 4levels's full-sized avatar

Erik Van Kelst 4levels

View GitHub Profile
@4levels
4levels / cloudSettings
Created July 2, 2018 09:47
vscode settings
{"lastUpload":"2018-07-02T09:47:58.093Z","extensionVersion":"v2.9.2"}
@4levels
4levels / add_host_ip_to_emulated_device.txt
Created May 30, 2018 12:01
Change Android emulator /etc/hosts file
# adb root
# adb remount
# adb shell
# 192.168.121.50 is the IP of a local bridged connection with fixed ip with kvm/qemu
# api-local.yourconfiguredvhost.com is the local domain used for testing, running on a vm on the host
echo "127.0.0.1 localhost\n::1 ip6-localhost\n192.168.121.50 api-local.yourconfiguredvhost.com" > /system/etc/hosts
@4levels
4levels / app_GraphQL_schema.json
Last active March 21, 2021 17:59
Sample setup Lighthouse with Lumen
# Just the basics: User with Images
scalar DateTime @scalar(class: "DateTime")
type User {
id: ID! @globalId
name: String
email: String
created_at: DateTime!
updated_at: DateTime!
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
@4levels
4levels / Render a tree in a Diem list widget.markdown
Created June 30, 2010 23:39
Render a nested set categories with grouped product counts

NestedSet's are a great way of using nested data in a programmatic way. However working with them is quite complex without any helpers. Doctrine provides a NestedSet manager which is built-in into symfony and Diem. While the Diem 5.1-nestedset branch handles nestedsets in the admin, a ready to use nested set is not available in the front widgets.

As this is quiet straightforward and a common feature I'll stow how I usually render a nestedset in a typical category/products relationship.

@4levels
4levels / Render a gallery or grid from a records DmGallery behaviour.markdown
Created June 30, 2010 10:47
Render a gallery or grid from a records DmGallery behaviour