Skip to content

Instantly share code, notes, and snippets.

View mgalang's full-sized avatar

Marc Galang mgalang

View GitHub Profile

Keybase proof

I hereby claim:

  • I am mgalang on github.
  • I am marcgalang (https://keybase.io/marcgalang) on keybase.
  • I have a public key ASCxh0YpYNjtVx-sGZkfvu1ej3TAjsjp7Xfq2274byF_SAo

To claim this, I am signing this object:

@mgalang
mgalang / d8_snippets.md
Last active June 17, 2022 13:58
Drupal 8 snippets

Create link from text and url

$url = Url::fromRoute($route_name);
$link = Link::fromTextAndUrl($text, $url);

Create link from route

$link = Link::createFromRoute('Link Text', 'route_name')->getUrl();
@mgalang
mgalang / gist:065a5522c638f97c1a6a
Created March 28, 2013 12:05
Kohana database transaction
$db = Database::instance();
// start
$db->query(null,'START TRANSACTION');
// rollback
$db->query(null,'ROLLBACK');
// commit
$db->query(null,'COMMIT');
@mgalang
mgalang / new_kohana_app.sh
Created May 14, 2012 11:17
Basic installation script for Kohana 3.2
git init
git submodule add git://github.com/kohana/core.git system
git submodule add git://github.com/kohana/database.git modules/database
git submodule add git://github.com/kohana/userguide.git modules/userguide
git submodule add git://github.com/kohana/image.git modules/image
git submodule add git://github.com/kohana/codebench.git modules/codebench
git submodule add git://github.com/kohana/auth.git modules/auth
git submodule add git://github.com/kohana/pagination.git modules/pagination
git submodule add git://github.com/kohana/orm.git modules/orm