Skip to content

Instantly share code, notes, and snippets.

View FnTm's full-sized avatar

Janis Peisenieks FnTm

  • Whimsical Inc.
  • Riga
View GitHub Profile
@bytespider
bytespider / Route.php
Created August 25, 2011 08:57
Zend Framework Rest Route for "/{api_version}/{controller}/{identifier}/{action}" uri scheme
<?php
class App_Rest_Route extends Zend_Rest_Route
{
public function match($request, $partial = false)
{
if (!$request instanceof Zend_Controller_Request_Http) {
$request = $this->_front->getRequest();
}
$this->_request = $request;
$this->_setRequestKeys();
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@alecharp
alecharp / keep-jenkins-plugins-uptodate.groovy
Last active December 22, 2022 06:01
Simple groovy script to upgrade active plugins when new versions are available
jenkins.model.Jenkins.getInstance().getUpdateCenter().getSites().each { site ->
site.updateDirectlyNow(hudson.model.DownloadService.signatureCheck)
}
hudson.model.DownloadService.Downloadable.all().each { downloadable ->
downloadable.updateNow();
}
def plugins = jenkins.model.Jenkins.instance.pluginManager.activePlugins.findAll {
it -> it.hasUpdate()