The following is a list of programming languages and their syntax for doing metaprogramming.
Macros in C are just glorified string substitution.
// Adds a pseudo element :after that clears floats, preventing them from riding | |
// up into the element, while still allowing the element to wrap around floats | |
// before it. This is useful for ensuring floating elements remain in place, | |
// vertically, when the non-floating elements are too short to push them down. | |
=postclear($side: both) | |
&:after | |
content: " " | |
display: block | |
clear: $side |
lst = [] | |
def foo1(bar=lst): | |
bar.append(1) | |
print(bar) | |
foo1() | |
foo1() | |
foo1() |
% Typesetting | |
%\usepackage[margin=1in]{geometry} | |
%\usepackage{fullpage} | |
\usepackage{verbatim} | |
% Fonts and stuff | |
%\usepackage{times} | |
%\usepackage{soul} | |
\usepackage{color} | |
%\usepackage[usenames,dvipsnames]{color} |
\begin{figure} | |
\centering | |
\subfloat[] | |
{ | |
\includegraphics[scale=.6]{fig-1.pdf} | |
\label{fig:foo-1} | |
} | |
\par | |
\subfloat[] | |
{ |
; Had this | |
(let [g (nf.graph6/graph6-to-set (:graph6 rec)), | |
unfairness (nf.graphs/unfairness g)] | |
...) | |
; and replaced with this | |
(let [unfairness (-> rec | |
:graph6 |
<?php | |
add_filter( 'rwmb_meta_boxes', function( $meta_boxes ) | |
{ | |
$meta_boxes[] = array( | |
'id' => 'brand_product', | |
'title' => 'Brands and Products', | |
'post_types' => array( 'post', 'page' ), | |
'context' => 'normal', | |
'priority' => 'high', | |
// Conditional Logic can be applied to Meta Box |
<div class="pull-left">...</div> | |
<div class="pull-right">...</div> | |
<!-- Classes --> | |
<style type='text/css'> | |
.pull-left { | |
float: left !important; | |
} | |
.pull-right { |
my %circ = ( | |
'(' => ')', | |
'[' => ']' | |
); | |
token circumfix_operation { (<circumfix_open>) <expression> (<circumfix_close>) <?{ %circ{$0} eq $1 }> } | |
token circumfix_open { @(%circ.keys) } | |
token circumfix_close { @(%circ.values) } |
public final static class CircBuf { | |
private ArrayList<String> circArray; | |
private int size = 6; | |
public CircBuf(final int size) { | |
this.size = size; | |
circArray = new ArrayList<String>(this.size); | |
} |