Skip to content

Instantly share code, notes, and snippets.

View joshdcomp's full-sized avatar

Josh Compton joshdcomp

View GitHub Profile
$('.notification_queue').on(
{
mouseenter: function(e){
tooltipHandler.toggle(e);
},
mouseleave: function(e){
tooltipHandler.toggle(e);
}
},
'.notification_actions i'
@joshdcomp
joshdcomp / Gruntfile.js
Created May 12, 2014 21:27
Quick gist for injecting a filepath/separator into your concatted script files. You're concatting your scripts right?
grunt.initConfig({
concat: {
options: {
//Get the filepath, format it, put in whatever separator you want, and echo the script itself
// src = the actual code of whatever your file is
// filepath = Sandstorm, Darude
process: function(src, filepath){
var lines = '\n//--------------------------------------------------\n'
var final_name = filepath.substring(filepath.lastIndexOf('/js/') + 1, filepath.length);//.join('-');
return( lines
@joshdcomp
joshdcomp / bling.js
Created February 5, 2015 20:21
code questions
function Bling(ice){
this.ice = ice;
this.thing();
$('.do_thing').on('click', function(){
console.log(this.ice);
});
}
//trollolololololol
@function gray($shade){
@debug "You spelled *grey* wrong";
@return rgb($shade, $shade, $shade);
}
@function grey($shade){
@debug "You spelled *gray* wrong";
@return rgb($shade, $shade, $shade);
}
@joshdcomp
joshdcomp / fonts.scss
Created March 27, 2015 19:27
Complex data structures
$_helvetica: (
'font-family': #{"Helvetica", sans-serif},
'font-weight': (
'default': 300,
'light': 100,
'normal': 300,
'semi-bold': 500,
'bold': 700
),
'line-height': 1.3,
@joshdcomp
joshdcomp / content.scss
Last active August 29, 2015 14:19
how I'd make a
@keyframes content-peep{
//bounce frames
}
.content{
margin-top: 100vh;
&-is_peeping{
animation: content-peep 200ms 1 500ms;
}
@joshdcomp
joshdcomp / .bash_profile
Created April 27, 2015 14:45
Git completion and vim syntax sugar
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
@joshdcomp
joshdcomp / Gruntfile.js
Last active August 29, 2015 14:20
Super generic grunt file/setup for less
// This was set up using the help of this tut:
//http://merrickchristensen.com/articles/gruntjs-workflow.html
module.exports = function(grunt) {
// grunt.loadNpmTasks('grunt-contrib-jshint'); // load lint
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
@joshdcomp
joshdcomp / functions.php
Created May 5, 2015 14:43
Building the post thumbnail markup based on the original size
<?php
/**
* Given a post ID, return the permalink for the original size post thumbnail
*
* @param int $ID post id
* @return string deep link for a post thumbnail
*/
function _thumb_link($ID) {
$toReturn = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' );
return $toReturn[0];