Skip to content

Instantly share code, notes, and snippets.

View adamwooding's full-sized avatar
🏠
Working from home

Adam Wooding adamwooding

🏠
Working from home
View GitHub Profile
@leabs
leabs / navbar.astro
Created March 8, 2023 16:56
Astro - Set active class on Navbar component.
<!--Set active class on nav when the page is active -->
<script>
const nav = document.querySelector(".navbar");
const navLinks = nav.querySelectorAll("a");
const currentURL = window.location.href;
navLinks.forEach((link) => {
if (link.href === currentURL) {
link.classList.add("active");
}
});
@umayr
umayr / recover-deleted-branch.sh
Created April 1, 2016 11:41
How to recover a deleted branch
## Pre-requisite: You have to know your last commit message from your deleted branch.
git reflog
# Search for message in the list
# a901eda HEAD@{18}: commit: <last commit message>
# Now you have two options, either checkout revision or HEAD
git checkout a901eda
# Or
git checkout HEAD@{18}
@enamhasan
enamhasan / order-template.liquid
Created March 23, 2016 11:12
Shopify Order Printer Template with product image, variations and line item properties
<p style="float: right; text-align: right; margin: 0;">
{{ "now" | date: "%m/%d/%y" }}<br />
Invoice for {{ order_name }}
</p>
<div style="float: left; margin: 0 0 1.5em 0;" >
<strong style="font-size: 2em;">{{ shop_name }}</strong><br /><br />
{{ shop.address }}<br/>
{{ shop.city }} {{ shop.province_code }} {{ shop.zip | upcase }}<br/>
{{ shop.country }}
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@malarkey
malarkey / Contract Killer 3.md
Last active May 8, 2024 16:02
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………

@kraz
kraz / make.bat
Last active March 13, 2019 16:52
Windows batch for simulating twitter bootstrap make functionality
@echo off
SET BOOTSTRAP=.\docs\assets\css\bootstrap.css
SET BOOTSTRAP_LESS=.\less\bootstrap.less
SET BOOTSTRAP_RESPONSIVE=.\docs\assets\css\bootstrap-responsive.css
SET BOOTSTRAP_RESPONSIVE_LESS=.\less\responsive.less
SET "CHECK= "
SET HR=##################################################
::Try to use the local build tools, if installed instead of global ones
@AmyStephen
AmyStephen / list.php
Created August 1, 2012 12:47
To create a .gitignore with a list of all files in Repository
<?php
/**
* @package Molajo
* @copyright 2012 Amy Stephen. All rights reserved.
* @license GNU GPL v 2, or later and MIT, see License folder
*
* Place in the root of your website - execute it - and copy the results into your .gitignore
*/
$current_path = __DIR__;
@Tetsuro
Tetsuro / jquery.t-and-c.js.liquid
Last active October 6, 2015 06:27
jQuery for Terms and Conditions
<script type="text/javascript" charset="utf-8">
//<![CDATA[
// Including jQuery conditionnally.
if (typeof jQuery === 'undefined') {
document.write({{ "http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" | script_tag | json }});
document.write('<script type="text/javascript">jQuery.noConflict();<\/script>');
}
//]]>
</script>
@cedricwalter
cedricwalter / 404.html
Created January 16, 2012 11:08
Trying to secure Nginx the most for Joomla CMS under Ubuntu 11.10
<!-- to be saved at /usr/share/nginx/html/404.html -->
<html lang="en"><head><meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, minimum-scale=1, width=device-width">
<title>Error 404 (Not Found)!!1</title>
<style>
*{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}
</style>
<link type="text/css" rel="stylesheet" href="chrome-extension://cpngackimfmofbokmjmljamhdncknpmg/style.css"><script type="text/javascript" charset="utf-8" src="chrome-extension://cpngackimfmofbokmjmljamhdncknpmg/page_context.js"></script></head><body screen_capture_injected="true">
<!--