Skip to content

Instantly share code, notes, and snippets.

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

Hans Kuijpers hans2103

🏠
Working from home
View GitHub Profile
@martine-dowden
martine-dowden / responsive-table.html
Last active December 15, 2021 14:41
Reponsive Table
<html>
<head>
<title>Responsive Table</title>
<meta charset="UTF-8">
<meta name="description" content="How to create a responsive table">
<meta name="keywords" content="HTML,CSS">
<meta name="author" content="Martine Dowden">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
@renekreijveld
renekreijveld / gencodes.php
Last active October 11, 2017 07:47
Joomla CLI script to generate unique codes with a predefined length.
<?php
/**
* gencodes.php
*
* This Joomla CLI script can generate unique codes of a predefined length.
* The codes are written to standard output.
*
* Modify the value of variables $how_many and $code_length to your liking.
*
* Installation: upload this file to your Joomla CLI folder.
@troyfontaine
troyfontaine / 1-setup.md
Last active May 12, 2024 15:17
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

@renekreijveld
renekreijveld / getCategories.php
Last active February 22, 2017 16:06
This function will build and return an array of all parent category id's that an article belongs to.
/**
* This function will build and return an array of all parent category id's that an article belongs to.
* Written by René Kreijveld, email [at] renekreijveld.nl
* 22-feb-2017
*
* Example function call for an article with id = 100:
* $parentCategories = $this->getCategories(100, 0);
*
*/
private function getCategories($artId, $catId)
@adamreisnz
adamreisnz / package.json
Last active January 19, 2024 13:01
Simple pure npm scripts build process
{
"name": "project-name",
"description": "Template for static sites",
"version": "1.0.0",
"homepage": "http://www.project-name.com",
"author": {
"name": "Adam Reis",
"url": "http://adam.reis.nz"
},
"license": "UNLICENSED",
@ankurk91
ankurk91 / github_gpg_key.md
Last active April 9, 2024 16:34
Signing git commits using GPG (Ubuntu/Mac)

Github : Signing commits using GPG (Ubuntu/Mac) 🔐

  • Do you have an Github account ? If not create one.
  • Install required tools
  • Latest Git Client
  • gpg tools
# Ubuntu
sudo apt-get install gpa seahorse
# MacOS with https://brew.sh/
@TommyKolkman
TommyKolkman / BlockClass.php
Created May 30, 2016 13:23
Add product to cart in Magento 2
public function __construct(
\<Vendor>\<ModuleName>\Helper\HelperName $helperName,
array $data = []
) {
$this->_helperName = $helperName;
}
@mrkpatchaa
mrkpatchaa / README.md
Last active April 4, 2024 09:37
Bulk delete github repos

Use this trick to bulk delete your old repos or old forks

(Inspired by https://medium.com/@icanhazedit/clean-up-unused-github-rpositories-c2549294ee45#.3hwv4nxv5)

  1. Open in a new tab all to-be-deleted github repositores (Use the mouse’s middle click or Ctrl + Click) https://github.com/username?tab=repositories

  2. Use one tab https://chrome.google.com/webstore/detail/onetab/chphlpgkkbolifaimnlloiipkdnihall to shorten them to a list.

  3. Save that list to some path

  4. The list should be in the form of “ur_username\repo_name” per line. Use regex search (Sublime text could help). Search for ' |.*' and replace by empty.

@alexgleason
alexgleason / neat-flex-grid.scss
Created February 1, 2016 04:35
Bourbon/Neat Flexbox Grid
/*
Based on code by Kevin Lamping
source: http://codepen.io/klamping/pen/waMOeX
*/
@mixin flex-grid {
display: flex;
flex-wrap: wrap;
margin-left: -$gutter;
margin-top: -$gutter;
@jsoningram
jsoningram / googlefonts.css
Created August 10, 2015 22:58
@font-face for local Google fonts
/* Lato */
@font-face {
font-family: 'Lato';
font-style: normal;
font-weight: 100;
src: local('Lato Hairline'), local('Lato-Hairline'), url(../fonts/Lato-Hairline.ttf) format('truetype');
}
@font-face {
font-family: 'Lato';
font-style: normal;