This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Angular File Input</h1> | |
<!-- IMG preview --> | |
<img [src]="fileDataUri"> | |
<p *ngIf="errorMsg" style="color:red">{{errorMsg}}</p> | |
<!-- Form with submit method and template variable (#fileInput) --> | |
<form (submit)="uploadFile($event)"> | |
<input | |
type="file" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Excute: | |
openssl req -x509 -newkey rsa:2048 -keyout domain.key -out domain.csr -days 1000 -nodes -subj '/CN=domain.com' | |
*files are generated in cwd | |
Note: | |
-nodes (prevents asking for password) | |
-subj '/CN=domain.com' (assigns it to the correct local domain) | |
After cert is created make sure its in the nginx config |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/************ | |
concrete/src/Session/Session.php | |
session validation starts at line 52 end at line 69 | |
comment out $session->invalidate(); | |
behind c9 proxies we know the ip and agent change each request | |
leave comment for c9.io development only | |
*************/ | |
namespace Concrete\Core\Session; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Loader::model('block_types'); | |
$bt = BlockType::getByHandle('your_block_handle'); | |
$tools_dir = Loader::helper('concrete/urls')->getBlockTypeToolsURL($bt); | |
echo $tools_dir . '/name_of_tools_file_without_php_at_the_end'; | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$n = Loader::helper('navigation'); | |
$link = Page::getByID($this->cId); | |
$url = $n->getLinkToCollection($link); | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$tmc = $("#termsy_master").clone().attr('id', 'his').show(); | |
$("h2", $tmc).text('new title'); | |
$(".sm", $tmc).attr('id', 'sm_new_id'); | |
$(".di", $tmc).attr('id', 'di_new_id'); | |
$tmc.appendTo(".article-content"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
App::before(function($request) | |
{ | |
if(!Request::secure()) | |
{ | |
$url = Request::url(); | |
$url = str_replace('http', 'https', $url); | |
return Redirect::to($url); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$form = Loader::helper('form'); | |
Loader::element('editor_config'); | |
Loader::element('editor_controls'); | |
echo $form->textarea("textareaID", $details, array('class'=>"ccm-advanced-editor")); | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
defined('C5_EXECUTE') or die("Access Denied."); | |
$al = Loader::helper('concrete/asset_library'); | |
//$al->file for all files | |
$al->file(‘thumbnail’, ‘thumbnailFileID’, ‘Select Thumbnail’); | |
//$al->image for images only | |
echo $al->image($formElementID, $formName, $chooseText, $fileObject = null); | |
?> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>HTML5 Starter</title> | |
<meta name="description" content=""> | |
<meta name="author" content=""> | |
<link rel="stylesheet" href="css/style.css"> | |
<!--[if lt IE 9]> | |
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> |
NewerOlder