Skip to content

Instantly share code, notes, and snippets.

View mstaack's full-sized avatar
🎯
Focusing

Max mstaack

🎯
Focusing
View GitHub Profile
module.exports = {
'can log in at vimeo': function (test) {
'use strict';
test.expect(1)
.open('http://vimeo.com/log_in')
.type('#email', 'foo@bar.com')
.type('#password', 'baz')
.click('.submit .btn')
.assert.text('#page_header h1 a', 'foobar')
@mstaack
mstaack / PHPtoICS.php
Last active August 29, 2015 14:19 — forked from jakebellacera/ICS.php
<?php
// Variables used in this script:
// $summary - text title of the event
// $datestart - the starting date (in seconds since unix epoch)
// $dateend - the ending date (in seconds since unix epoch)
// $address - the event's address
// $uri - the URL of the event (add http://)
// $description - text description of the event
// $filename - the name of this file for saving (e.g. my-event-name.ics)
//
<?php
class InitialDbMigrationCommand extends CConsoleCommand
{
public function run($args) {
$schema = $args[0];
$tables = Yii::app()->db->schema->getTables($schema);
$addForeignKeys = '';
$dropForeignKeys = '';
@mstaack
mstaack / snippet.php
Last active August 29, 2015 14:20 — forked from cebe/snippet.php
<?php
// ...
$runner=new CConsoleCommandRunner();
$runner->commands=array(
'commandName' => array(
'class' => 'application.commands.myCommand',
),
);
ob_start();
<?
/**
* Metadata Helps to get metadata about models,controllers and actions in application*
*
* For using you need:
* 1. Place this file to directory with components of your application (your_app_dir/protected/components)
* 2. Add it to 'components' in your application config (your_app_dir/protected/config/main.php)
* 'components'=>array(
* 'metadata'=>array('class'=>'Metadata'),
* ...
<template name="register">
<div class="register-container">
<legend>Registration</legend>
<form role="form" action="#" class="register">
<div class="form-group">
<input type="text" id="firstname" class="form-control" placeholder="Firstname">
</div>
<div class="form-group">
<input type="text" id="lastname" class="form-control" placeholder="Lastname">
/**
* Created by max on 08.07.15.
*/
Template['register'].events({
'submit #register': function (event, template) {
event.preventDefault();
alert('wurst');
}
});
@mstaack
mstaack / gulpfile.js
Created October 27, 2015 21:53
demo gulpfile
var elixir = require('laravel-elixir');
/*
|--------------------------------------------------------------------------
| Elixir Asset Management
|--------------------------------------------------------------------------
|
| Elixir provides a clean, fluent API for defining some basic Gulp tasks
| for your Laravel application. By default, we are compiling the Sass
| file for our application, as well as publishing vendor resources.
@mstaack
mstaack / install-oci8.sh
Created December 15, 2015 19:45 — forked from crynobone/install-oci8.sh
Provision Oracle InstantClient for Ubuntu Vagrant.
#!/usr/bin/env bash
export LD_LIBRARY_PATH=/opt/oracle/instantclient
export ORACLE_HOME=/opt/oracle/instantclient
echo "Instantclient path: instantclient,/opt/oracle/instantclient"
sudo pecl install oci8
sudo echo "extension=oci8.so" >> /etc/php5/fpm/php.ini
@mstaack
mstaack / middleware
Created October 30, 2015 20:04
middleware
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Contracts\Auth\Guard;
class Authenticate
{
/**