Skip to content

Instantly share code, notes, and snippets.

View amwelles's full-sized avatar
👩‍💻

Autumn Welles amwelles

👩‍💻
View GitHub Profile
/* this is what CodeKit outputs, every time you save the file */
<?php
// get the request
$data = $_REQUEST['payload'];
// sanitize the data
$unescaped_data = stripslashes($data);
// set up our object
$person = json_decode($unescaped_data);
// assign variables
@amwelles
amwelles / widget.html
Created June 13, 2013 19:48
Simple twitter widget with new OAuth & [codebird-js](https://github.com/mynetx/codebird-js). Uses a bit of jQuery, but you could just as easily use vanilla JS.
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Twitter widget</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" ></script>
<script src="sha1.js" type="text/javascript"></script>
<script src="codebird.js" type="text/javascript"></script>
<script>
@amwelles
amwelles / autumn-sandbox.sql
Created August 29, 2013 23:00
wat is going on here
--
-- Table structure for table `term_synonym`
--
DROP TABLE IF EXISTS `term_synonym`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `term_synonym` (
`tsid` int(11) NOT NULL AUTO_INCREMENT,
`tid` int(10) unsigned NOT NULL DEFAULT '0',
@amwelles
amwelles / gist:6391303
Created August 30, 2013 15:55
'Synonym page' is the one I'm trying to get to work.
$view = new view;
$view->name = 'taxonomy_term';
$view->description = 'A view to emulate Drupal core\'s handling of taxonomy/term; it also emulates Views 1\'s handling by having two possible feeds.';
$view->tag = 'default';
$view->base_table = 'node';
$view->core = 0;
$view->api_version = '2';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('relationships', array(
@amwelles
amwelles / background-text.scss
Created September 19, 2013 20:51
Tries to determine what color the text should be based on the background color. Add "true" and it'll also include the background color.
// mixin
@mixin background-text($background, $include-bg:false, $color:#000) {
@if (lightness($background) > 50%) {
$color: #000;
} @else {
$color: #fff;
}
@if ($include-bg:true) {
background-color: $background;
}
@amwelles
amwelles / SassMeister-input.scss
Created February 7, 2014 15:39
Generated by SassMeister.com.
// ----
// Sass (v3.3.0.rc.2)
// Compass (v1.0.0.alpha.17)
// ----
.button {
border-radius: 3px;
background: grey;
color: white;
}
// works with compass
@mixin hamburger($color:white, $line-width:5px) {
$transparent: rgba($color, 0);
@include background-image(linear-gradient(
$color $line-width,
$transparent $line-width,
$transparent ($line-width*2),
$color ($line-width*2),
$color ($line-width*3),
@amwelles
amwelles / themename.behaviors.js
Created July 2, 2014 14:51
Masonry.js and Drupal Views
(function ($) {
Drupal.behaviors.themenameMasonry = {
attach: function() {
var masonryView = $('.masonry-view .view-content');
masonryView.imagesLoaded(function () {
masonryView.masonry({
itemSelector: '.views-row'
$tab: 768px;
$nav: 865px;
$desk: 1024px;
$super: 1080px;
$susy: (
container: 1040px, // change this if you add padding outside the grid
columns: 12,
column-width: 65px,
gutters: 20px/65px,