/* from: http://css3clickchart.com/#text-overflow */
.target {
white-space: nowrap;
overflow: hidden;
-o-text-overflow: ellipsis;
-ms-text-overflow: ellipsis;
text-overflow: ellipsis; /* or "clip" */
}
/* from: http://css3clickchart.com/#text-overflow */
.target {
white-space: nowrap;
overflow: hidden;
-o-text-overflow: ellipsis;
-ms-text-overflow: ellipsis;
text-overflow: ellipsis; /* or "clip" */
}
/* from: http://www.paulirish.com/2012/box-sizing-border-box-ftw/ */
/* apply a natural box layout model to all elements, but allowing components to change */
html {
box-sizing: border-box;
}
*, *:before, *:after {
box-sizing: inherit;
}
# For localhost on XAMPP, and others
# file: httpd-vhosts.conf
# restart apache after making changes
#------------------------------------------------------- DOMAIN
<VirtualHost *:80>
ServerName DOMAIN.dev
ServerAlias www.DOMAIN.dev
DocumentRoot "/path/to/document/root/DOMAIN/"
<Directory "/path/to/document/root/DOMAIN/">
AllowOverride All
Order Allow,Deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:443>
ServerName DOMAIN.dev
ServerAlias www.DOMAIN.dev
DocumentRoot "/path/to/document/root/DOMAIN/"
<Directory "/path/to/document/root/DOMAIN/">
AllowOverride All
Order Allow,Deny
Allow from all
Require all granted
</Directory>
SSLEngine on
SSLCertificateFile "/path/to/ssl/crt/DOMAIN.crt"
SSLCertificateKeyFile "/path/to/ssl/key/DOMAIN.key"
</VirtualHost>
// Get element width/height
var element = $('.class');
var width = element.width();
var height = element.height();
// Set element width/height
var element = $('.class');
element.css( 'width', value + 'px' );
element.css( 'height', value + 'px' );
// On window resize
$(window).resize(function(){
// do stuff
});
// On element resize
element.resize(function(){
// do stuff
});
/* x-offset, y-offset, blur radius, color */
.text_shadow {
text-shadow: x_offset y_offset blur_radius color;
}
/* multiple shadows, comma-separated */
.text-shadow {
text-shadow: shadow1, shadow2, shadow3;
}
/* from http://www.themeshock.com/css-text-shadow/ */
.pressed {
color: #222;
text-shadow: 0px 1px 1px #4d4d4d;
}
.embossed {
color: #066;
text-shadow: -1px -1px 1px rgba(255, 255, 255, 0.1), 1px 1px 1px rgba(0, 0, 0, 0.5);
}
.neon {
color: #fff;
text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px #fff, 0 0 20px #ff2d95, 0 0 30px #ff2d95, 0 0 40px #ff2d95, 0 0 50px #ff2d95, 0 0 75px #ff2d95;
letter-spacing: 5px;
}
.fire {
color: #fff;
text-shadow: 0px -1px 4px white, 0px -2px 10px yellow, 0px -10px 20px #ff8000, 0px -18px 40px red;
}
.3D {
color: #fff;
text-shadow: 0px 1px 0px #999, 0px 2px 0px #888, 0px 3px 0px #777, 0px 4px 0px #666, 0px 5px 0px #555, 0px 6px 0px #444, 0px 7px 0px #333, 0px 8px 7px #001135;
}
.retro {
color: #990F0A;
text-shadow: 5px 5px 0px #EEE, 7px 7px 0px #707070;
}
.acid {
color:#00ff0f;
text-shadow: 0px 0px 10px #00ff0f, -1px -1px #000;
}
.shadow {
color:#333;
text-shadow: -5px 5px 5px rgba(0,0,0, 0.3);
}
.alpha {
color: rgba(0, 174, 239, 0.2);
text-shadow: rgba(0, 0, 30, 0.08) 0px 5px 2px;
}
.alpha3D {
color: transparent;
text-shadow: rgba(245, 245, 255, 0.35) 0 0px 0px, rgba(0, 0, 30, 0.08) 0px 2px 2px, rgba(0, 0, 30, 0.20) 0px 2px 1px, rgba(0, 0, 30, 0.40) 0px 2px 1px, rgba(0, 0, 0, 0.08) -5px 5px 2px;
}
.anaglyphs {
color: rgba(0, 168, 255, 0.5);
text-shadow: 3px 3px 0 rgba(255, 0, 180, 0.5);
}
.blur {
color: rgba(255, 255, 255, 0.1);
text-shadow: 0px 0px 15px rgba(255, 255, 255, 0.5), 0px 0px 10px rgba(255, 255, 255, 0.5);
}
// Double check the src
function add_ie_html5_shim() {
echo '<!–[if lt IE 9]>';
echo '<script src=”http://html5shim.googlecode.com/svn/trunk/html5.js”></script>';
echo '<![endif]–>';
}
if ($GLOBALS['is_IE']) {
add_action('wp_head', 'add_ie_html5_shim');
}
// Add DOM element to Builder before container output (right after opening body tag)
function add_dom_element() {
echo '<div class"custom-class></div>';
}
add_action('builder_layout_engine_render_container', 'add_dom_element' );
// Only need to load a page once to get this into db, then comment out (or place in theme/plugin activation)
// WP Codex: http://codex.wordpress.org/Roles_and_Capabilities
$result = add_role(
'basic_contributor',
__( 'Basic Contributor' ),
array(
'read' => true, // true allows this capability
'edit_posts' => true,
'delete_posts' => false, // Use false to explicitly deny
)
);
if ( null !== $result ) {
echo 'Yay! New role created!';
} else {
echo 'Oh... the basic_contributor role already exists.';
}
// Or remove a role
remove_role( 'basic_contributor' );
function callback( $atts, $content = '' ) {
extract( shortcode_atts( array(
'text' => '',
'link' => '',
), $atts ) );
return '';
}
add_shortcode( 'name', 'callback' );
// TODO: rework this
$('.container img').each(function() {
var maxWidth = 100, // Max width for the image
maxHeight = 100, // Max height for the image
ratio = 0, // Used for aspect ratio
w = $(this).width(), // Current image width
h = $(this).height(); // Current image height
// Check if the current width is larger than the max
if(width > maxWidth){
ratio = maxWidth / width; // get ratio for scaling image
$(this).css("width", maxWidth); // Set new width
$(this).css("height", height * ratio); // Scale height based on ratio
h = h * ratio; // Reset height to match scaled image
w = w * ratio; // Reset width to match scaled image
}
// Check if current height is larger than max
if(height > maxHeight){
ratio = maxHeight / height; // get ratio for scaling image
$(this).css("height", maxHeight); // Set new height
$(this).css("width", width * ratio); // Scale width based on ratio
w = w * ratio; // Reset width to match scaled image
h = h * ratio; // Reset height to match scaled image
}
});
$('.container img').each(function() {
var mw = 100, // Max width
mh = 100, // Max height
r = 1, // Aspect ratio
w = $(this).width(), // Current width
h = $(this).height(); // Current height
// set ratio
r = w > mw ? mw/w : mh/h;
// Check if current width is larger than the max
if( w > mw ){
// r = maxWidth / width; // get ratio for scaling image
$(this).css("width", mw); // Set new width
$(this).css("height", h * r); // Scale height based on ratio
}
// Check if current height is larger than max
if( h > mh ){
// r = maxHeight / height; // get ratio for scaling image
$(this).css("width", w * r); // Scale width based on ratio
$(this).css("height", mh); // Set new height
}
w = w * ratio; // Reset width to match scaled image
h = h * ratio; // Reset height to match scaled image
});
<h1>Sorting A Table With jQuery UI</h1>
<table id="sort" class="grid" title="Kurt Vonnegut novels">
<thead>
<tr><th class="index">No.</th><th>Year</th><th>Title</th><th>Grade</th></tr>
</thead>
<tbody>
<tr><td class="index">1</td><td>1969</td><td>Slaughterhouse-Five</td><td>A+</td></tr>
<tr><td class="index">2</td><td>1952</td><td>Player Piano</td><td>B</td></tr>
<tr><td class="index">3</td><td>1963</td><td>Cat's Cradle</td><td>A+</td></tr>
<tr><td class="index">4</td><td>1973</td><td>Breakfast of Champions</td><td>C</td></tr>
<tr><td class="index">5</td><td>1965</td><td>God Bless You, Mr. Rosewater</td><td>A</td></tr>
</tbody>
</table>
var fixHelperModified = function(e, tr) {
var $originals = tr.children();
var $helper = tr.clone();
$helper.children().each(function(index) {
$(this).width($originals.eq(index).width())
});
return $helper;
},
updateIndex = function(e, ui) {
$('td.index', ui.item.parent()).each(function (i) {
$(this).html(i + 1);
});
};
$("#sort tbody").sortable({
helper: fixHelperModified,
stop: updateIndex
}).disableSelection();
// anywhere
printf( 'Copyright © 2010-%s COMPANY_NAME. All Rights Reserved', date( 'Y' ) );
// in WP with translation/textdomain
printf( __( 'Copyright © 2010-%s COMPANY_NAME. All Rights Reserved', 'textdomain' ), date( 'Y' ) );
// can also make future year(s) conditional
$year = date('Y');
$copyright_years = $year == '2014' ? $year : '2014-'.$year;
.scss {
@include transition(all .2s linear);
}
// becomes
.css {
-webkit-transition: all 0.2s linear;
-moz-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
transition: all 0.2s linear;
}
.scss {
@include box-shadow(#aaaaaa 1px 1px 2px);
}
// becomes
.css {
-webkit-box-shadow: #aaaaaa 1px 1px 2px;
-moz-box-shadow: #aaaaaa 1px 1px 2px;
box-shadow: #aaaaaa 1px 1px 2px;
}
.scss {
@include border-radius(10px);
}
// becomes
.css {
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
}
.scss {
@include background(linear-gradient(#ffffff, #F6F6F6));
}
// becomes
.css {
background: -webkit-linear-gradient(#ffffff, #f6f6f6);
background: -moz-linear-gradient(#ffffff, #f6f6f6);
background: -o-linear-gradient(#ffffff, #f6f6f6);
background: linear-gradient(#ffffff, #f6f6f6);
}
Index: languages/ini.js
===================================================================
--- languages/ini.js (revision 199)
+++ languages/ini.js (revision 200)
@@ -1,8 +1,7 @@
hljs.LANGUAGES.ini =
{
case_insensitive: true,
- defaultMode:
- {
+ defaultMode: {
contains: ['comment', 'title', 'setting'],
illegal: '[^\\s]'
},
*** /path/to/original timestamp
--- /path/to/new timestamp
***************
*** 1,3 ****
--- 1,9 ----
+ This is an important
+ notice! It should
+ therefore be located at
+ the beginning of this
+ document!
! compress the size of the
! changes.
It is important to spell
POST /task?id=1 HTTP/1.1
Host: example.org
Content-Type: application/json; charset=utf-8
Content-Length: 19
{"status": "ok", "extended": true}
;Settings relating to the location and loading of the database
[Database]
ProfileDir=.
ShowProfileMgr=smart
Profile1_Name[] = "\|/_-=MegaDestoyer=-_\|/"
DefaultProfile=True
AutoCreate = no
[AutoExec]
use-prompt="prompt"
Glob=autoexec_*.ini
AskAboutIgnoredPlugins=0
user www www;
worker_processes 2;
pid /var/run/nginx.pid;
error_log /var/log/nginx.error_log debug | info | notice | warn | error | crit;
events {
connections 2000;
use kqueue | rtsig | epoll | /dev/poll | select | poll;
}
http {
log_format main '$remote_addr - $remote_user [$time_local] '
'"$request" $status $bytes_sent '
'"$http_referer" "$http_user_agent" '
'"$gzip_ratio"';
send_timeout 3m;
client_header_buffer_size 1k;
gzip on;
gzip_min_length 1100;
#lingering_time 30;
server {
server_name one.example.com www.one.example.com;
access_log /var/log/nginx.access_log main;
rewrite (.*) /index.php?page=$1 break;
location / {
proxy_pass http://127.0.0.1/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
charset koi8-r;
}
location /api/ {
fastcgi_pass 127.0.0.1:9000;
}
location ~* \.(jpg|jpeg|gif)$ {
root /spool/www;
}
}
}
# rewrite`s rules for wordpress pretty url
LoadModule rewrite_module modules/mod_rewrite.so
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [NC,L]
ExpiresActive On
ExpiresByType application/x-javascript "access plus 1 days"
Order Deny,Allow
Allow from All
<Location /maps/>
RewriteMap map txt:map.txt
RewriteMap lower int:tolower
RewriteCond %{REQUEST_URI} ^/([^/.]+)\.html$ [NC]
RewriteCond ${map:${lower:%1}|NOT_FOUND} !NOT_FOUND
RewriteRule .? /index.php?q=${map:${lower:%1}} [NC,L]
</Location>
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
BEGIN;
CREATE TABLE "topic" (
"id" serial NOT NULL PRIMARY KEY,
"forum_id" integer NOT NULL,
"subject" varchar(255) NOT NULL
);
ALTER TABLE "topic" ADD CONSTRAINT forum_id FOREIGN KEY ("forum_id") REFERENCES "forum" ("id");
-- Initials
insert into "topic" ("forum_id", "subject") values (2, 'D''artagnian');
select count(*) from cicero_forum;
-- this line lacks ; at the end to allow people to be sloppy and omit it in one-liners
COMMIT
[
{
"title": "apples",
"count": [12000, 20000],
"description": {
"text": "...",
"sensitive": false
}
},
{
"title": "oranges",
"count": [17500, null],
"description": {
"text": "...",
"sensitive": false
}
},
{
"color_scheme": "Packages/User/HUG.tmTheme",
"detect_slow_plugins": false,
"font_size": 12.0,
"ignored_packages":
[
"Vintage",
"AdvancedNewFile"
],
"scroll_past_end": true,
"theme": "Refined-Dark.sublime-theme",
"trim_trailing_white_space_on_save": true
}
]
<?xml version="1.0"?>
<response value="ok" xml:lang="en">
<text>Ok</text>
<comment html_allowed="true"/>
<ns1:description><![CDATA[
CDATA is <not> magical.
]]></ns1:description>
<a></a> <a/>
<dict>
<key>name</key>
<string>JSON String</string>
<key>scope</key>
<string>meta.structure.dictionary.json string.quoted.double.json</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#CFCFC2</string>
</dict>
</dict>
</response>
<!DOCTYPE html>
<html>
<head>
<title>Title</title>
<style>body {width: 500px;}</style>
<script type="application/javascript">
jQuery(document).ready(function($){
function init() {
return true;
}
keyword.each(function( i,e ){
// console.log('here');
if ( $(this).text() == 'var' ) {
$(this).html( '<span class="var">var</span>' )
}
});
});
</script>
</head>
<body>
<p checked class="title" id='title'>Title</p>
<!-- here goes the rest of the page -->
</body>
</html>
/**
* get_template
*
* @since 0.1
*/
function get_custom_post_type_template( $template ) {
global $post;
if ( $post->post_type == 'my_post_type' ) {
$template = dirname( __FILE__ ) . '/post-type-template.php';
}
return $template;
}
add_filter( 'template_include', 'get_custom_post_type_template' );
/* more filters (from http://codex.wordpress.org/Template_Hierarchy)
archive_template
author_template
category_template
tag_template
taxonomy_template
date_template
home_template
front_page_template
page_template
paged_template
search_template
single_template
attachment_template
*/
// SCSS
#field_2_5 {
label.gfield_label {
display: none;
}
&.here, div.ginput_container {
margin-left: 10px;
}
}
@import "compass/reset";
// variables
$colorGreen: #008000;
$colorGreenDark: darken($colorGreen, 10);
@mixin container {
max-width: 980px;
}
// mixins with parameters
@mixin button( $color:green ) {
@if ( $color == green ) {
background-color: #008000;
}
@else if ( $color == red ) {
background-color: #B22222;
}
}
button {
@include button( red );
@include border( 1px solid #999999);
}
div,
.navbar,
#header,
input[type="input"] {
font-family: "Helvetica Neue", Arial, sans-serif;
width: auto;
margin: 0 auto;
display: block;
}
.row-12 > [class*="spans"] {
border-left: 1px solid #B5C583;
}
// nested definitions
ul {
width: 100%;
padding: {
left: 5px;
right: 5px;
}
left: 15px;
right: 15px;
li {
float: left;
margin-right: 10px;
.home:last-child {
background: url(http://placehold.it/20) scroll no-repeat 0 0;
background: url('http://placehold.it/20') scroll no-repeat 0 0;
}
}
}
.banner {
@extend .container;
}
a {
color: $colorGreen;
&:hover { color: $colorGreenDark; }
&:visited { color: #c458cb; }
}
@for $i from 1 through 5 {
.span#{$i} {
width: 20px*$i;
}
}
@mixin mobile {
@media screen and (max-width : 600px) {
@content;
}
}
#tagged, .tag a {
color: #3B3F42;
-webkit-transition: all .1s ease-in;
-moz-transition: all .1s ease-in;
-o-transition: all .1s ease-in;
-ms-transition: all .1s ease-in;
transition: all .1s ease-in;
}
a:hover {
color: #3B3F42;
width: 100%;
text-decoration: underline;
border-bottom: 3px solid #35ab43;
font-size: 2em;
background: #444444 url(images/background.png) no-repeat top left;
background: #444444 url("images/background.png") no-repeat top left;
}
a:focus {
color: #3B3F42;
font-size: 2.5em;
border: 1px solid #aaa;
}
div:first-child {
color: #3B3F42;
}
// with jQuery
get_stamp = function( str ) {
var stamp = new Date( str );
stamp = stamp.getTime() / 1000;
stmp += 'this string\'s with an escaped-type character';
stmp2 = "this string's with an ... or you can change the quotes";
return stamp;
}
if ( this.variable == 4 || num != 9 || ( this.variable == 6 && num != 8 ) ) {}
if (this.variable===4||num!=9||(this.variable!==6&&num<=8)){}
var num_vr = 4 * $num / 27 + num2 - 6.3,
num_vr=4*$num/27+num2-6.3,
hey = $(this);
myfuncname = function() {
// run code
}
tp4.jPlayer({ready:function(){$(this).jPlayer('setMedia',{oga:ap+'04'+og,m4a:ap+'04'+ma,mp3:ap+'04'+m3});},swfPath:'assets',preload:'auto',supplied:'oga,m4a,mp3',wmode:'window',smoothPlayBar:true});
function init_highlight(block, flags) {
try {
if (block.className.search(/\bno\-highlight\b/) != -1)
return processBlock(block.function, true, 0x0F) + ' class=""';
} catch (e) {
/* handle exception */
var e4x = ''
+ '<div>Example'
+ '<p>1234</p></div>';
e++;
h--;
}
for (var i = 0 / 2; i < classes.length; i++) { // "0 / 2" should not be parsed as regexp
if (checkCondition(classes[i]) === undefined)
return /\d+[\s/]/g;
}
console.log(Array.every(classes, Boolean));
}
/**
* Add classes to Builder modules
*
* Function name calling shouldn't be 'it_builder_loaded'
* in case parent theme is using it already.
*/
if ( ! function_exists( 'oz_builder_loaded' ) ) {
function oz_builder_loaded() {
// --> module label class
builder_register_module_style( 'content', 'Blue ', 'content-blue' );
builder_register_module_style( 'widget-bar', 'Blue (full width)', 'widget-bar-blue' );
builder_register_module_style( 'navigation', 'Subnav Blue', 'subnav-blue' );
builder_register_module_style( 'html', 'Blue Background', 'html-blue' );
builder_register_module_style( 'image', 'Blue Background (full width)', 'image-blue');
builder_register_module_style( 'header', 'White Header', 'header-white');
builder_register_module_style( 'footer', 'White Footer', 'footer-white');
}
add_action( 'it_libraries_loaded', 'oz_builder_loaded' );
}
/*
* With embedded HTML ... not so good
*/
function show_metabox_syntax() {
global $post;
extract( $this->metaboxes['syntax']['field'] );
$meta = get_post_meta($post->ID, $id, true);
// echo $meta;
?>
<input type="hidden" name="codesnips_syntax_metabox_nonce" value="<?php
echo wp_create_nonce(basename(__FILE__)) ?>" />
<div class="lang-syntax-wrap">
<div class="codesnips_field_type_<?php echo str_replace(' ', '_', $type) ?>">
<?php foreach ($options as $key => $option) { ?>
<span class="lang-syntax <?php echo $key ?>">
<input id="<?php echo $key ?>" type="radio" name="<?php
echo $id ?>" value="<?php echo $key ?>"<?php
echo ($meta == $key ? ' checked="checked"' : '') ?> />
<label for="<?php echo $key ?>"><?php echo $option ?></label>
</span>
<?php }// end foreach ?>
<?php echo $desc != '' ? '<br><span class="desc">' . stripslashes($desc) . '</span>' : '' ?>
<div class="clr"></div>
</div>
</div>
<?php
}
define( 'DS', DIRECTORY_SEPARATOR ); // DIRECTORY_SEPARATOR
define( 'OZ_CONTENT_DIR', 'assets' ); //
define( 'WP_CONTENT_DIR', ABSPATH .OZ_CONTENT_DIR ); // /svr-root/path-to/site-root/assets
define( 'WP_CONTENT_URL', WP_SITEURL.DS.OZ_CONTENT_DIR ); // http://site.dev/assets
define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR.DS.'plugins' ); // /svr-root/path-to/site-root/assets/plugins
define( 'WP_PLUGIN_URL', WP_CONTENT_URL.DS.'plugins' ); // http://site.dev/assets/plugins
define( 'UPLOADS', OZ_CONTENT_DIR.DS.'files' ); // http://site.dev/assets/files
define( 'THISHOMEY', 'this is a homey');
echo THISHOMEY;
require_once 'Zend/Uri/Http.php';
namespace Location\Web;
interface Factory
{
static function _factory();
}
abstract class URI extends BaseURI implements Factory
{
abstract function test();
$num_var = (4 * $num) / 27 + $num2 - 6.3;
$num_var=(4*$num)/27+$num2-6.3;
$this->object->item = 0;
$concat = 'This string get\'s to ';
$concat .= 'be added to by another line';
$morect = "Another for \"me\" and you!";
/**
* Returns a URI
*
* @return URI
*/
static public function _factory($stats = array(), $uri = 'http')
{
echo __METHOD__;
$uri = explode(':', $uri, 0b10);
$schemeSpecific = isset($uri[1]) ? $uri[1] : '';
$desc = 'Multiline
description == | = | != | === | !== | description
description';
// Security check
if (!ctype_alnum($scheme)) {
throw new Zend_Uri_Exception('Illegal scheme');
}
return [
'uri' => $uri,
'value' => null,
];
}
if ( $var == 'timed' || $var != '' ( $var === '' && $var !== '' ) ) {}
if ($var=='timed'||$var!=''($var===''&&$var!=='')){}
if ( $var < '' || $var > '' || $var <= '' || $var => '' ) {}
if ($var<''||$var>''||$var<=''||$var=>''){}
}
__halt_compiler () ; datahere
datahere
datahere */
datahere