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', '[email protected]')
.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 / yii - create cdbcriteria from arrray
Last active December 16, 2015 10:32
Create Criteria From fields and values
private function getCriteriaForRow($row)
{
$fullCriteria = new CDbCriteria();
foreach ($this->mapping as $uploadColumn => $databaseColumn) {
$value = $row[array_search($uploadColumn, $this->fileHeader)];
$criteria = new CDbCriteria();
@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 / app.blade.php
Created October 30, 2015 19:09
layout laravel
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Application</title>
<!-- Compiled Styles -->