Skip to content

Instantly share code, notes, and snippets.

View sakulstra's full-sized avatar
:octocat:
tl;dr;

Lukas sakulstra

:octocat:
tl;dr;
View GitHub Profile
@sakulstra
sakulstra / new adminMenus
Last active August 29, 2015 13:56
new adminMenu
<?php
public function menuTree($menus, $options = array(), $depth = 0, $parent = null)
{
$options = Hash::merge(array(
'icon' => array(
'class' => 'fa fa-'
),
'root' => array(
'ul' => array(
'class' => 'nav nav-sidebar nav-stacked',
@sakulstra
sakulstra / gist:10564255
Last active August 29, 2015 13:59
cakephp pagination to specified id
<?php
public function index() {
if($this->request->is('post') && isset($this->request->query['message']) && !isset($this->request->query['page'])){
$logs = $this->IrcLogs->find()->order(['IrcLogs.created' => 'desc']);
$result = $logs->where(['IrcLogs.id >=' => $this->request->query['message']])->count();
$this->paginate['page'] = ceil($result/$this->paginate['limit']);
}
$this->set('ircLogs', $this->paginate($this->IrcLogs));
}
@sakulstra
sakulstra / gist:641ae02e081007d58ede
Last active August 29, 2015 14:03
cakephp 3.0 rest
<?php
//SitesController
class SitesController extends AppController {
public $components = array('RequestHandler');
/**
* Index method
*
* @return void
*/
<core-scroll-header-panel condenses>
<core-toolbar>
<paper-tabs selected="home" valueattr="name" self-end>
<paper-tab name="test1">Home</paper-tab>
<paper-tab name="test2">About</paper-tab>
</paper-tabs>
</core-toolbar>
<div class="container" layout vertical center content>
<site-view></site-view>
</div>
@sakulstra
sakulstra / designer.html
Created November 23, 2014 11:37
designer
<link rel="import" href="../polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
import pprint
def setup(app):
app.connect("builder-inited", testb)
def testb(app):
pprint.pprint(app.builder.css_files)
Receivers{
id,
phone_number
}
Datasets{
id,
reveiver_phone_number,
...
}
@sakulstra
sakulstra / events.html
Created October 28, 2015 21:21
calendar javscript
<template name="events">
{{#each events}}
{{title}}-{{date}}<br />
{{/each}}
</template>
@sakulstra
sakulstra / email.js
Created November 29, 2015 22:11
email isn't sent on register
process.env.MAIL_URL = 'smtp://' +
encodeURIComponent(username) + ':' +
encodeURIComponent(password) + '@' +
encodeURIComponent(server) + ':' + port;
// 2. Format the email
//-- Set the from address
Accounts.emailTemplates.from = 'test@test.com';
//-- Application name
dashboard.route('/app/:id',{
action: function(){
BlazeLayout.render("yourLayout", {
main: "yourView"
});
}
});