Skip to content

Instantly share code, notes, and snippets.

@tortillaj
tortillaj / _.md
Created March 20, 2015 17:22
perlin ink
@tortillaj
tortillaj / gist:80dfd6a7030bf50b4855
Last active August 29, 2015 14:18
Gotour Loops and Functions
package main
import (
"fmt"
"math"
)
func NewtonSqrt(x float64, z float64) float64 {
return z - ((math.Pow(z, 2.0) - x) / (2 * z))
}
@tortillaj
tortillaj / SassMeister-input-HTML.html
Last active August 29, 2015 14:20
Sass Variables
<div>
<h1>This text is red</h1>
<p>Yet paragraphs are blue. <a href="#">Links are blue too.</a></p>
</div>
@tortillaj
tortillaj / SassMeister-input-HTML.html
Last active August 29, 2015 14:20
Nesting classes and Elements in Sass
<div>
<h1>Nesting classes and elements</h1>
<p>Elements and classes can be nested. Here we nested a paragraph tag. <a href="#">Links can be nested too.</a></p>
<p class="highlighted-text">Classes can be nested too!</p>
</div>
@tortillaj
tortillaj / SassMeister-input-HTML.html
Created May 1, 2015 13:31
Using the ampersand operator in Sass
<div class="container">
<h1>Nesting with the Ampersand Operator</h1>
<a href="#">It's common to use & on link styles.</a>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus ultrices, justo vel vulputate viverra, tortor nulla porta sem</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus ultrices, justo vel vulputate viverra, tortor nulla porta sem</p>
<p class="container__note">Here is a different kind of ampersand usage.</p>
</div>
<p class="button">Button</p>
<p>Somtimes you don't have control over the CSS class. In that case, you can "extend" a previously made class.</p>
<p class="something-else">Read More</p>
<p>Try overriding a propery in the .something-else class after the @extend directive.</p>
@tortillaj
tortillaj / SassMeister-input-HTML.html
Created May 1, 2015 13:40
Extending a placeholder class in Sass
<p>A "placeholder" class does not print out the class itself. It is useful when you have CSS properties that don't apply to any specific element in the HTML, but will be used in many places on elements with different selectors.</p>
<p class="something-else">Read More</p>
<p>Try overriding a propery in the .something-else class after the @extend directive.</p>
<h1>Mixins</h1>
<p>Mixins are very useful when you have many elements that have the same basic styles, but with a few differences.</p>
<p>Some examples are buttons. Maybe sometimes a button is blue, other times there are green buttons, and other times the button is transparent.</p>
<p>A mixin is a kind of function that will let you feed it parameters to make these minor changes to common styles.</p>
<p>The @mixin directive let's you declare (define) a mixin.</p>
<p>The @include directive let's you use a mixin.</p>
<p class="button">Read More</p>
<a class="button-red">Important!</a>
@tortillaj
tortillaj / mysql-backup.sh
Last active January 4, 2016 18:09
Easy MySQL backups with Bash
#!/bin/bash
# Database credentials
user="XXXXX"
password="XXXXX"
host="XXXXX"
db_name="XXXXX"
# Other options
backup_path="/location/of/your/backups"
@tortillaj
tortillaj / _.md
Created April 20, 2016 19:14
sin waves