Skip to content

Instantly share code, notes, and snippets.

View dreamyguy's full-sized avatar
👨‍💻 Code-bending

Wallace Sidhrée dreamyguy

👨‍💻 Code-bending
View GitHub Profile
@dreamyguy
dreamyguy / check-if-function-exists.js
Last active August 29, 2015 14:01
Check if function exists, through the console.
// a loose check, to see if object exists
if (something) {
console.log('%c something() is present! ', 'background: #bada55; color: black');
} else {
console.log('%c something() is NOT present! ', 'background: #de1e7e; color: white');
}
// a strict check, object must be a function
if (typeof(something) === 'function') {
console.log('%c something() is present! ', 'background: #bada55; color: black');
@Celleb
Celleb / _columnfix.scss
Last active December 23, 2015 08:09
Fixes grid layout problems for zurb foundation 4 for internet explorer 8 and 7
/* zurb foundation 4 grid column fix for ie8 and below */
@mixin columnFix($columns: 12){
$i: 1;
@while $i < $columns + 1 {
$colWidth: ($i/$columns)*100%;
$colWidth7: ($i/$columns)*98%;
& .large-#{$i}, & .small-#{$i} {
width: $colWidth;
*width: $colWidth7; //sets the width for ie7
@dreamyguy
dreamyguy / install-osx-from-external-drive.md
Last active January 6, 2016 23:34
OSX's fresh install from external media
  • Download the latest OSX from App Store.

    • The installer will open itself after its download. Do not proceed with install - close it!
    • Once downloaded the installer will be available on Applications folder.
  • Run the following command, taking care to rename the OSX version accordingly and to specify the name of the volume (make sure the command is typed in a single line):

sudo /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/Resources/createinstallmedia --volume /Volumes/<name-of-volume> --applicationpath /Applications/Install\ OS\ X\ El\ Capitan.app --nointeraction

  • The prompt will ask for system password...
@brianfeister
brianfeister / attach_heads.js
Created December 15, 2012 13:04
Sub-theming engine for Grunt.js + Roots Theme + Twitter Bootstrap
/**
* Task: attach_heads
* Description: Set the heads for all themes declared in themes.json
*/
module.exports = function(grunt) {
'use strict';
var fs = require('fs');
var path = require('path');
@dreamyguy
dreamyguy / vertical-spacing.scss
Last active February 16, 2017 14:17
Vertical spacing mixin for Zurb Foundation
/* ===================================
* Vertical spacing for Zurb Foundation Grid
*
* Copyright (c) 2017, Wallace Sidhrée
* MIT License
====================================== */
$vs-positions: top bottom;
$vs-total: 8 !default; // range of classes to be created (in this case 1-8)
$vs: $gutter-size-half;
@existemi
existemi / bash_profile
Last active April 17, 2018 13:59 — forked from natelandau/.bash_profile
My preferred bash setup
#!bin/bash
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
@bobjackman
bobjackman / git-stats
Last active July 12, 2018 13:52
Get a summary of total LOC added, removed, gross line changes, && net total LOC. Credit to (alex)[http://stackoverflow.com/users/887836/alex] modified by (kogi)[http://stackoverflow.com/users/84762/kogi]
#!/usr/bin/env bash
# usage:
# git-stats #gives stats for the whole branch
# git-stats --author="yourname here" #gives stats for specific author
#
# though not all tested, this should be compatible with all limiting options supported by git-log (https://www.kernel.org/pub/software/scm/git/docs/git-log.html#_commit_limiting)
git log --pretty=tformat: --numstat $@ "`git merge-base HEAD develop`..HEAD" | gawk '{ adds += $1 ; subs += $2 ; net += $1 - $2 ; gross += $1 + $2 ; commits += 1 } END { print "total commits\tadded loc\tremoved loc\tgross loc\tnet loc\n"; printf "%d\t%d\t%d\t%d\t%d\n", commits, adds, subs, gross, net }' | column -s $'\t' -t
@jay-johnson
jay-johnson / example .travis.yml
Created November 27, 2015 07:44
example .travis.yml
sudo: required
language: ruby
services:
- docker
before_install:
- echo "Testing Docker Hub credentials"
- docker login -e=$DOCKER_EMAIL -u=$DOCKER_USERNAME -p=$DOCKER_PASSWORD
// Original code from http://www.blog.highub.com/mobile-2/a-fix-for-iphone-viewport-scale-bug/
var metas = document.getElementsByTagName('meta');
var i;
if (navigator.userAgent.match(/iPhone/i)) {
for (i=0; i<metas.length; i++) {
if (metas[i].name == "viewport") {
metas[i].content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0";
}
}
@stolinski
stolinski / providerCompose.js
Created April 23, 2019 17:40
ProviderComposer
function ProviderComposer({ contexts, children }) {
return contexts.reduceRight(
(kids, parent) =>
React.cloneElement(parent, {
children: kids,
}),
children
);
}