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
import * as cdk from 'aws-cdk-lib'; | |
import { Certificate, CertificateValidation } from 'aws-cdk-lib/aws-certificatemanager'; | |
import { Peer, Port, SecurityGroup, Vpc } from 'aws-cdk-lib/aws-ec2'; | |
import { FileSystem, PerformanceMode, ThroughputMode } from 'aws-cdk-lib/aws-efs'; | |
import { ApplicationLoadBalancer } from 'aws-cdk-lib/aws-elasticloadbalancingv2'; | |
import { LambdaTarget } from 'aws-cdk-lib/aws-elasticloadbalancingv2-targets'; | |
import { Effect, PolicyStatement, Role, ServicePrincipal } from 'aws-cdk-lib/aws-iam'; | |
import { Code, Function, FunctionUrlAuthType, FileSystem as LambdaFileSystem, Runtime } from 'aws-cdk-lib/aws-lambda'; | |
import { ARecord, HostedZone, RecordTarget } from 'aws-cdk-lib/aws-route53'; | |
import { LoadBalancerTarget } from 'aws-cdk-lib/aws-route53-targets'; |
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
package main | |
import ( | |
"context" | |
"fmt" | |
"github.com/aws/aws-sdk-go-v2/aws" | |
"github.com/aws/aws-sdk-go-v2/config" | |
"github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue" | |
"github.com/aws/aws-sdk-go-v2/service/dynamodb" |
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
// This should not require two lines... | |
$class = $this->_get_row_object($row); | |
$row = new $class; | |
// Surely this should work? But no... | |
$class = new {$this->_get_row_object($row)}; |
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('BASEPATH') OR exit('No direct script access allowed'); | |
class Plugin_Page_Parent extends Plugin | |
{ | |
public function title() | |
{ | |
// Use the URI to get the previous page name, and set the title accordingly | |
$uri_parts = explode('/', $this->uri->uri_string()); |
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
An important note here is that you cannot extend helpers or libraries found in the system/ directory (neither system/cms or system/codeigniter) as the CodeIgniter Loader class does not know to look there. This is a "limitation" of CodeIgniter itself, so if you need to extend core files you will need to either extend in system/cms or extend there. If you do this make sure you are tracking your changes with Git as otherwise you will end up loosing your modifcations next time you upgrade PyroCMS. |
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
#!/usr/bin/env ruby | |
def is_valid_isbn13?(isbn13) | |
sum = 0 | |
13.times { |i| sum += i % 2 == 0 ? isbn13[i].to_i : isbn13[i].to_i * 3 } | |
0 == sum % 10 | |
end | |
puts "Loading file and reading ISBNs..." | |
isbns = [] |
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 | |
$randomBackgrounds = array( | |
'FF0000', | |
'CC0000', | |
'0000FF', | |
'url(test.png)', | |
// more colours or images | |
); | |
?> | |
<style type="text/css"> |
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
function errorpage($message, $cuscon = false, $goBack = true, $exit = true) { | |
if (!$cuscon) { | |
echo " | |
<table width=\"100%\"> | |
<tr> | |
<td> | |
<table width=\"100%\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"> | |
<tr> | |
<td align=\"center\"> |
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
function caps($str) { | |
$split = explode(' ', $str); | |
for($i = 0; $i < count($split); $i++) { | |
$split[$i] = ucfirst(strtolower($split[$i])); | |
} | |
$str = implode(' ', $split); | |
return $str; | |
} |
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
jamie@projectx-server:~$ mkdir mercurial-test | |
jamie@projectx-server:~$ cd mercurial-test/ | |
jamie@projectx-server:~/mercurial-test$ wget http://mercurial.selenic.com/release/mercurial-1.9.tar.gz | |
--2011-07-08 10:34:39-- http://mercurial.selenic.com/release/mercurial-1.9.tar.gz | |
Resolving mercurial.selenic.com... 173.11.57.243 | |
Connecting to mercurial.selenic.com|173.11.57.243|:80... connected. | |
HTTP request sent, awaiting response... 200 OK | |
Length: 2964382 (2.8M) [application/x-gzip] | |
Saving to: `mercurial-1.9.tar.gz' |
NewerOlder