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
# Custom Functions | |
// Destination: author.php | |
// Arguments: $ocean_cream_author_field = $field from https://codex.wordpress.org/Template_Tags/the_author_meta | |
// $ocean_cream_author_localization = name of field in ocean_cream.pot file. | |
// https://stackoverflow.com/questions/18860870/translation-function-calls-must-not-contain-php-variables | |
// $ocean_cream_author_hide_me = practically nothing. This function show field only, when field with this same name in profile.php is not empty. | |
// $ocean_cream_author_string_me = practically nothing. This function rewrite your variable to string type. | |
// $ocean_cream_author_display_translation = rewrite $ocean_cream_author_localization to accepted translation and allow me translate it in Loco Translate … or another program. Clue: Today, we cannot create automatic translations, so you have to add it manually in /languages/ocean-cream.pot | |
// $ocean_cream_author_class_body_start = for example <span class="abc"> or <dd class "abc"> | |
// $ocean_c |
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
class Test < Roda | |
route do |r| | |
r.root do | |
'<form action="login" method="post"> | |
<input type="email" name="user"> | |
<input type="password" name="pass"> | |
<input type="submit"> | |
</form>' | |
end | |
r.post 'login' do |
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
class Test < Roda | |
plugin :render, engine: 'slim' | |
route do |r| | |
r.get 'test' do | |
view :hello | |
end | |
r.root do | |
'Home, Sweet Home' | |
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
#public/.htaccess | |
RewriteEngine On | |
RewriteBase /public/ | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*)$ index.php?$1 [L,QSA] |
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
{ | |
"require":{ | |
"phug/phug":"^0.3.2" | |
} | |
} |
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
//you should replace ä with any non-usable character. | |
test = ` | |
ä | |
. | |
heloo | |
ä | |
`.replace(/(\s{4})/, "START") | |
.replace(".", "DISPLAY") | |
.replace(/(\s{2})/, "STOP") | |
.replace(/ä/g, "") |
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
<input type="email" name="user"> | |
<input type="password" name="key"> | |
<input name="submit" type="submit" onclick="login()"> |
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
session[:key] = 'value' | |
request.session['key'] |
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 | |
include_once $_SERVER['DOCUMENT_ROOT'] . '/wp-config.php'; | |
global $wpdb; | |
$wpdb->get_var('Single row'); | |
$result = $wpdb->get_results('Multiple rows'); | |
foreach ( $result as $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 $myposts = get_posts( $args ); ?> | |
<form id="formName"> | |
<?php | |
foreach ( $myposts as $service ) { | |
$service_lenght = get_post_meta($service->ID, 'Lenght'); | |
?> | |
<label> | |
<h1><?php echo $service->post_title ?> </h1> | |
<img src="<?php get_the_post_thumbnail_url($service->ID); ?>" /> |
OlderNewer