Skip to content

Instantly share code, notes, and snippets.

View ademers's full-sized avatar
🧡

Andrea ademers

🧡
View GitHub Profile
<?php
use craft\test\TestSetup;
ini_set('date.timezone', 'UTC');
// Use the current installation of Craft
define('CRAFT_STORAGE_PATH', __DIR__ . '/_craft/storage');
define('CRAFT_TEMPLATES_PATH', __DIR__ . '/_craft/templates');
define('CRAFT_CONFIG_PATH', __DIR__ . '/_craft/config');
actor: Tester
paths:
tests: tests
log: tests/_output
data: tests/_data
support: tests/_support
envs: tests/_envs
settings:
bootstrap: _bootstrap.php
params:
<?php
$channel = $_GET['channel'];
$content = array();
$entries_query = $this->EE->db->query("SELECT * FROM exp_comments AS comments LEFT JOIN exp_channel_titles AS titles ON comments.entry_id = titles.entry_id LEFT JOIN exp_members m ON m.member_id = comments.author_id WHERE comments.status = 'o' AND titles.status = 'open' AND comments.channel_id = '$channel'");
foreach ($entries_query->result_array() as $id => $row) {
$content[$id] = array();
$content[$id]['comment'] = $row['comment'];
@ademers
ademers / export.php
Last active July 20, 2018 15:54 — forked from engram-design/export.php
ExpressionEngine PHP Export into JSON: Members by group
<?php
$group = $_GET['id'];
$content = array();
$entries_query = $this->EE->db->query("SELECT * FROM exp_members WHERE exp_members.group_id = '$group'");
foreach ($entries_query->result_array() as $id => $row) {
$content[$id] = array();
// Remove spaces from EE usernames
This file has been truncated, but you can view the full file.
2017/07/20 13:02:56 [info] [application] $_GET=array (
'p' => 'admin/utils/logs',
)
$_COOKIE=array (
'YII_CSRF_TOKEN' => 'd72f87b4a861656641fe202dce080b5636eebdc7s:81:"QGCbSdxW5rEMR6TvLv~StDstl8ahOX_kwdxoR4D5|61fef96f779c2e68c52baa45c55ff3a04eed5799";',
'aec65fa07f69a723666179aac399e3dcusername' => 'fa4484264bc5847c4145e65b68e6612e8900d7ffs:60:"c5b804b08a56813e98bee4a4e2a20dc3efb40205czo3OiJhbmRyZWFkIjs=";',
'CraftSessionId' => '0065bdbe3ea6e77e3f47abe306fb1f45',
'aec65fa07f69a723666179aac399e3dc' => '50eb269f5b5017828e76c92c2086b97319dc5a73s:400:"1d7c0bb62a3dabbadd136e2a603b5b952b4499d7YTo2OntpOjA7czo3OiJhbmRyZWFkIjtpOjE7czozMjoiZksyZXBXQXVGUHJzV0gyaWQyaTVrbDVYanFKaTFVNXYiO2k6MjtzOjM2OiIzNTM2NTZmNi1hOTkzLTQ5MTEtODVjYi0xYjUzMzY2MmVmZTkiO2k6MztpOjE7aTo0O3M6MTIxOiJNb3ppbGxhLzUuMCAoTWFjaW50b3NoOyBJbnRlbCBNYWMgT1MgWCAxMF8xMV82KSBBcHBsZVdlYktpdC81MzcuMzYgKEtIVE1MLCBsaWtlIEdlY2tvKSBDaHJvbWUvNTkuMC4zMDcxLjExNSBTYWZhcmkvNTM3LjM2IjtpOjU7YTowOnt9fQ==";',
)
{
"user": [
{
"username": "usernameone",
"email": "usernameone@example.com"
},
{
"username": "usernametwo",
"email": "usernametwo@example.com"
}
@ademers
ademers / .gitignore
Created February 15, 2017 22:07 — forked from octocat/.gitignore
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
Verifying that "ademers.id" is my Blockstack ID. https://onename.com/ademers
Here are a few questions that will tee us up for a good conversation:
- Can you tell me about your project in a few sentences?
- What’s the timeframe? Does a certain event depend on this project launching?
- What are you looking for from us? Do you want us to design, build, and launch the whole site? Or do you have developers or other partners lined up and only need us for design?
- Have you already started on any part of the project? Do you have existing work? A new logo? Some rough designs or ideas for the site?
- How large is your team? What are the roles you envision on your end?
- How did you hear about our work? What specifically interests you about it? Any projects that you’re keen on?
- How much money have you set aside for this project?
- Are you talking to others about this project? Might we ask how many? What do you like about their work?
@ademers
ademers / set-project-perms.sh
Created April 21, 2016 15:29 — forked from khalwat/set-project-perms.sh
Properly set permissions for a Craft CMS install, including ensuring that files are all g-x. Set CHOWN_USER, CHOWN_GROUP, and BASE_DIR to whatever is appropriate, add directories that need to be writeable by the web server to DIRS[], then execute: sudo ./set-project-perms.sh PROJECT_NAME
#!/bin/bash
# Execute via: ./set-project-perms.sh PROJECT_NAME
# The paradigm is the entire project dir is owned by $CHOWN_USER with the group set to $CHOWN_GROUP
# $CHOWN_USER is an admin or user account that is used to edit files/templates, etc.
# $CHOWN_GROUP is the group of the webserver (e.g.: 'apache', 'nginx', 'httpd', etc.)
# The project dir permissions are set to 755 (-rwxr-xr-x) for directories and to 644 (-rw-r--r--) for files
# The permissions to $DIRS[] that need to be writeable are set to 775 (-rwxrwxr-x) for directories and
# 664 (-rw-rw-r--) for files. Add any assets directories, etc. as necessary.
# Change $BASE_DIR to the absolute path where your websites are stored (leaving it appended with '/$1')