Skip to content

Instantly share code, notes, and snippets.

View dmouse's full-sized avatar
🏠
Working from home

David Flores dmouse

🏠
Working from home
View GitHub Profile
@dmouse
dmouse / composer.json
Created February 27, 2014 02:33
default composer.json in composer_manager
{
"repositories": [
{
"type": "composer",
"url": "http://drugist.org"
}
]
}
<?php
namespace Drupal\badcamp\Controller;
use Drupal\Core\Controller\ControllerBase;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\ExtraModule\Annotation\Permission;
use Drupal\Core\Template\TwigEnvironment;
<?php
$finder = new Finder();
$dot_dot = '';
while (true){
try {
$iterator = $finder
->files()
->name('bootstrap.inc')
->in(getcwd() . '/'. $dot_dot . 'core/includes/');
@dmouse
dmouse / composer.json
Last active October 19, 2021 20:04
Run composer command from php script, controller, web,
{
"name": "hechoendrupal/composer-ui",
"description": "Composer UI",
"minimum-stability": "dev",
"authors": [
{
"name": "David Flore",
"email": "[email protected]"
}
],
@dmouse
dmouse / oauth.module
Created August 22, 2013 18:53
Drupal 8, OAuth sample hook_menu
<?php
function oauth_menu() {
//...
$menu['admin/config/services/oauth'] = array(
'title' => 'OAuth',
'description' => 'Settings for OAuth',
'route_name' => 'oauth_admin_form',
@dmouse
dmouse / aouth.routing.yml
Created August 22, 2013 18:43
Drupal 8, oauth sample routing
oauth_admin_form:
pattern: '/admin/config/services/oauth'
defaults:
_form: 'Drupal\oauth\Form\OAuthSettingsForm'
requirements:
_permission: 'administer oauth'
@dmouse
dmouse / OAuthSettingsForm.php
Last active December 21, 2015 13:09
Drupal 8, OAuth example settings form
<?php
/**
* @file
* Contains \Drupal\oauth\Form\OAuthSettingsForm.
*/
namespace Drupal\oauth\Form;
use Drupal\system\SystemConfigFormBase;
@dmouse
dmouse / oauth.settings.yml
Last active December 21, 2015 13:09
Drupal 8, OAuth module configuration file
enable_provider : 1
request_token_lifetime: 7200
login_path: 'user/login'
# uninstall old version
yum remove ruby rubygems -y
# Install deps
yum install -y libyaml libyaml-devel openssl libxml2-devel bison libxslt-devel openssl-devel tcl tk libffi tcl-devel tk-devel libffi-devel make
# Download Ruby
cd /usr/local/src/
wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p392.tar.gz
tar -xvzf ruby-1.9.3-p392.tar.gz
@dmouse
dmouse / defatult.vcl
Last active December 20, 2015 01:29
varnish Drupal 7 configuration
acl internal {
"127.0.0.0"/24;
}
backend web1 { .host = "192.168.1.1"; }
backend web2 { .host = "192.168.1.2"; }
director default_director round-robin {
{ .backend = web1; }
{ .backend = web2; }