Skip to content

Instantly share code, notes, and snippets.

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

Davor Peic davorpeic

🏠
Working from home
View GitHub Profile
@davorpeic
davorpeic / Single file upload for Assets.phtml
Last active August 29, 2015 14:23
Single file upload for Assets in Channel Form - ExpressionEngine
// So, I had a need to disable File browser that Assets comes with in frontend,
// and use simple file input
// Official docs are ok, but not complete
// http://docs.pixelandtonic.com/assets/templating/channel_form.html#using-a-file-input
// Lets say your fieldtype is called 'assets_test'
// This part is needed so we can 'reset' our field before the upload
{if '{assets_test:total_files}' > 0}
{assets_test}
<input type="hidden" name="assets_test[]" value="{file_id}" />
@davorpeic
davorpeic / Member_register_validate_members.phtml
Last active August 29, 2015 14:24
Postmaster hook for member activation notification - ExpressionEngine
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
// Put this file in /third_party/postmaster/hooks/
// We are using 'member_register_validate_members' hook
// https://ellislab.com/expressionengine/user-guide/development/extension_hooks/module/member_register/#member-register-validate-members
class Member_register_validate_members_postmaster_hook extends Base_hook {
protected $title = 'Member Register Validate Members';
@davorpeic
davorpeic / Single html file upload for Assets in Grid in Channel Form.phtml
Last active August 29, 2015 14:24
Single html file upload for Assets in Grid in Channel Form - ExpressionEngine
// Warning: this requieres latest (at this moment unpublished) version of Assets 2.5.1 addon
// So, I had a need to disable File browser that Assets comes with in frontend,
// and use simple file input in a Grid fieldtype
// Official docs are ok, but not complete for use in the Grid
// http://docs.pixelandtonic.com/assets/templating/channel_form.html#using-a-file-input
// Lets say your Grid fieldtype is called 'grid_field'
// and your Assets field is 'col_id_10' (you can check what ID is in DB [check grid table for that fieldtype])
@davorpeic
davorpeic / notifications.ts
Last active September 13, 2018 14:08
OneSignal service
import { Injectable } from "@angular/core";
import * as application from 'application';
let TnsOneSignal = require('nativescript-onesignal').TnsOneSignal;
@Injectable()
export class NotificationService {
constructor() {}