This file contains 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 | |
namespace DeployerCommands; | |
use Deployer\Command\InitCommand as ParentInit; | |
use Symfony\Component\Console\Command\Command; | |
use Symfony\Component\Console\Input\InputInterface; | |
use Symfony\Component\Console\Input\InputOption; | |
use Symfony\Component\Console\Output\OutputInterface; | |
use Symfony\Component\Console\Style\SymfonyStyle; |
This file contains 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
<div class="list-article-thumb"> | |
<a href="<?php echo esc_url( get_permalink() ); ?>"> | |
<?php | |
if ( has_post_thumbnail( ) ) { | |
the_post_thumbnail(); | |
} else { | |
$images_iterator = new FilesystemIterator( | |
WP_CONTENT_DIR . '/themes/yourthemename/images/', | |
FilesystemIterator::SKIP_DOTS | |
); |
This file contains 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
<div class="list-article-thumb"> | |
<a href="<?php echo esc_url( get_permalink() ); ?>"> | |
<?php | |
if ( has_post_thumbnail( ) ) { | |
the_post_thumbnail(); | |
} else { | |
echo '<img alt="" src="'. get_template_directory_uri() . '/images/placeholder.png' .'">'; | |
} | |
?> | |
</a> |
This file contains 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
#!/bin/bash | |
while read -r line; do | |
file=$(echo "$line" | awk -F'\t' '{ print $1 }') | |
[[ $file == 'connecting to'* ]] && continue | |
file_id="$(cut -d'|' -f1 <<<"$file")" | |
file_key="$(cut -d'|' -f2 <<<"$file")" | |
mkdir $file_id && cd "$_" | |
mongofiles -d meteor --prefix="cfs_gridfs.filesStore" get_id 'ObjectId("'$file_key'")' |
This file contains 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
SELECT table_name | |
FROM information_schema.tables | |
WHERE table_schema = 'databasename' | |
AND table_name LIKE 'prefix%'; | |
SELECT table_name | |
FROM information_schema.tables | |
WHERE table_schema = 'databasename' | |
AND table_name NOT LIKE 'prefix%'; |
This file contains 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 | |
function csv_to_array($filename='', $delimiter=',') | |
{ | |
if(!file_exists($filename) || !is_readable($filename)) | |
return FALSE; | |
$header = NULL; | |
$data = array(); | |
if (($handle = fopen($filename, 'r')) !== FALSE) | |
{ |
This file contains 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
select cpev.entity_id as entity_id, cpev.value as product_name from catalog_product_entity_varchar as cpev | |
join eav_attribute as ea on cpev.attribute_id = ea.attribute_id | |
join eav_entity_type as eet on ea.entity_type_id = eet.entity_type_id | |
join catalog_product_entity as cpe on cpe.entity_id = cpev.entity_id | |
where ea.attribute_code = 'name' | |
and eet.entity_type_code = 'catalog_product' | |
and cpe.type_id = 'downloadable'; |
This file contains 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 | |
foreach (new DirectoryIterator('files/') as $file) { | |
if ($file->isFile()) { | |
$file_name = $file->getFilename(); | |
$name = strtolower($file_name); | |
$letter1 = $name[0]; | |
$letter2 = $name[1]; | |
// Create first directory | |
if (!file_exists('media/downloadable/files/links/' . $letter1)) { |
This file contains 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
Ceilis-MacBook-Pro:colormyi ceili$ git push heroku master | |
Counting objects: 882, done. | |
Delta compression using up to 2 threads. | |
Compressing objects: 100% (746/746), done. | |
Writing objects: 100% (882/882), 3.87 MiB | 536 KiB/s, done. | |
Total 882 (delta 49), reused 0 (delta 0) | |
-----> Ruby/Rails app detected | |
-----> Using Ruby version: ruby-1.9.3 | |
-----> Installing dependencies using Bundler version 1.3.2 |
This file contains 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
source "https://rubygems.org" | |
ruby "1.9.3" | |
# Bundle edge Rails instead: | |
# gem 'rails', :git => 'git://github.com/rails/rails.git' | |
gem 'sqlite3' | |
# Gems used only for assets and not required |
NewerOlder