Skip to content

Instantly share code, notes, and snippets.

View JacobLett's full-sized avatar
🤠
hello!

Jacob Lett JacobLett

🤠
hello!
View GitHub Profile
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@sequielo
sequielo / gist:3086192
Created July 10, 2012 20:58
createCookie with JS
//! from http://www.quirksmode.org/js/cookies.html
function createCookie(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
@elidickinson
elidickinson / max_width_email.html
Created May 6, 2013 15:10
Email Template trick: max-width with outlook
<!--[if mso]>
<center>
<table><tr><td width="580">
<![endif]-->
<div style="max-width:580px; margin:0 auto;">
<p>This text will be centered and constrained to 580 pixels even on Outlook which does not support max-width CSS</p>
</div>
<!--[if mso]>
@ricardozea
ricardozea / ie67891011-css-hacks.txt
Last active February 2, 2023 15:17
IE CSS hacks - IE6, 7, 8, 9, 10, 11
IE6 Only
==================
_selector {...}
IE6 & IE7
==================
*html or { _property: }
IE7 Only
==================
@cosmicscr
cosmicscr / bootstrap_3_full_class_list
Last active June 3, 2023 00:07
bootstrap 3 full class list
Here are all the classes from Bootstrap 3 (version 3.1.1).
Method of extraction:
1. Download Bootstrap 3 and rename bootstrap.css as "bootstrap.html"
2. Add the following 24 lines of code to the very bottom of the bootstrap.html file:
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js"></script>
<script>
@praveenvijayan
praveenvijayan / Copy text directly from Photoshop text layer.
Last active December 19, 2019 05:23
Copy text directly from text layer. Works above photoshop cs6. Copy following script file into /Applications/Adobe Photoshop CC 2014/Presets/Scripts (MAC) or C:\Program Files\Adobe\Adobe Photoshop CC 2014\Presets\Scripts (WIN). Assign shortcut for easy access (cmd+option+c / ctrl+alt+c)
/*****************************************************************
*
* Copy Layer text 1.0 - by Praveen Vijayan! - http://www.decodize.com/
*
* Compatibility above Photoshop CS6
*
* Licensed under the Creative Commons Attribution 2.5 License - http://creativecommons.org/licenses/by/2.5/
*
*****************************************************************/
@sheck
sheck / kitchen-sink.html
Created August 10, 2015 21:47
Rock Bootstrap Kitchen Sink
<!-- Navbar
================================================== -->
<div class="bs-docs-section clearfix">
<div class="row">
<div class="col-lg-12">
<div class="page-header">
<h1 id="navbar">Navbar</h1>
</div>
<div class="bs-component">
@elijahmanor
elijahmanor / pros-cons-npmscripts-vs-gulp.md
Last active February 20, 2022 12:46
Pros and Cons of `npm scripts` vs Gulp

Comparison of npm scripts vs Gulp

npm scripts

Pros

  • npm scripts are low-level and leverage the actual library you want to use (example: "lint": "eslint ./")
  • package.json is a central place to see what scripts are available (also npm run will list all scripts)
  • When things get too complicated you can always defer to another file (example: "complex-script": "babel-node tools/complex-script.js")
  • npm scripts are more powerful than one might first think (pre/post hooks, passing arguments, config variables, chaining, piping, etc...)
@mgd020
mgd020 / cookies.js
Last active April 4, 2020 15:54
cookie functions
/*
cookies.get() gets all cookies by name
cookies.get('name') gets single cookie
cookies.set('name', 'value', {max_age, expires, path, domain})
cookies.del('name', {path, domain})
https://javascript-minifier.com/ = 731 bytes
window.cookies=function(){function e(e){return e.replace(/[;,\s]+/g,e=>escape(e))}var n=unescape,c=document,i="; ",o="",u="path",s="domain",p="max",t="age",r="expires",a="secure",h="samesite",f="=",g=p+"_"+t;function m(n,m,d){if(n){var l=[e(n),f,e(m||o)];(d=d||{})[u]&&l.push(i,u,f,d[u]),d[s]&&l.push(i,s,f,d[s]),d[g]?l.push(i,p,"-",t,f,d[g]):d[r]&&l.push(i,r,f,d[r].toUTCString()),d[a]&&l.push(i,a),d[h]&&l.push(i,h,f,d[h]),c.cookie=l.join(o)}}return{get:function(i){return i?new RegExp("\\b"+e(i).replace(/\W/g,"\\$&")+"=([^;]*)").exec(c.cookie)[1]:c.cookie.split("; ").map(e=>/([^=]+)=?(.*)/.exec(e).slice(1,3)).map(e=>[n(e[0]),n(e[1])]).reduce((e,n)=>(e[n[0]]=n[1],e),{})},set:m,del:function(e,n){(n=n||{})[g]=-1,m(e,o,n)}}}();
*/
@Langmans
Langmans / Gulpfile.js
Created September 19, 2016 12:02
gulp> scss > autoprefixer > css
/**
* To install:
* install npm
* cd public_html/files/stylesheets
* npm update
*
* to watch:
* gulp
* or to run sass once:
* gulp sass