Skip to content

Instantly share code, notes, and snippets.

View Teino1978-Corp's full-sized avatar

Teino Boswell Teino1978-Corp

  • Ocho Rios, Jamaica
View GitHub Profile
@Teino1978-Corp
Teino1978-Corp / gist:1d5d8d1ff6692e1d45f6
Created October 31, 2015 03:03 — forked from alecperkins/gist:2322939
+postclear Compass mixin
// 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
@Teino1978-Corp
Teino1978-Corp / list_as_default_func_arg.py
Created October 31, 2015 02:26 — forked from lig/list_as_default_func_arg.py
"def foo(bar=[])" explained
lst = []
def foo1(bar=lst):
bar.append(1)
print(bar)
foo1()
foo1()
foo1()
@Teino1978-Corp
Teino1978-Corp / yannisPackages.tex
Created October 31, 2015 02:10 — forked from mitliagkas/yannisPackages.tex
Commonly included latex packages
% Typesetting
%\usepackage[margin=1in]{geometry}
%\usepackage{fullpage}
\usepackage{verbatim}
% Fonts and stuff
%\usepackage{times}
%\usepackage{soul}
\usepackage{color}
%\usepackage[usenames,dvipsnames]{color}
@Teino1978-Corp
Teino1978-Corp / subfloat-row.tex
Created October 31, 2015 02:03 — forked from ashwin/subfloat-row.tex
Sub-figures arranged in rows in LaTeX
\begin{figure}
\centering
\subfloat[]
{
\includegraphics[scale=.6]{fig-1.pdf}
\label{fig:foo-1}
}
\par
\subfloat[]
{
@Teino1978-Corp
Teino1978-Corp / good_arrow.clj
Created October 30, 2015 23:48 — forked from gfredericks/good_arrow.clj
Replacing my bad logic with arrow syntax
; Had this
(let [g (nf.graph6/graph6-to-set (:graph6 rec)),
unfairness (nf.graphs/unfairness g)]
...)
; and replaced with this
(let [unfairness (-> rec
:graph6
@Teino1978-Corp
Teino1978-Corp / conditional-logic-example.php
Created October 30, 2015 23:42 — forked from tanftw/conditional-logic-example.php
Conditional Logic Basic Syntax
<?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
@Teino1978-Corp
Teino1978-Corp / MacrosInProgrammingLanguages.md
Created October 30, 2015 23:04 — forked from TheSeamau5/MacrosInProgrammingLanguages.md
Macros in Different Programming Languages

Macros/Metaprogramming in Programming Languages

The following is a list of programming languages and their syntax for doing metaprogramming.

C

Macros in C are just glorified string substitution.

<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);
}