Skip to content

Instantly share code, notes, and snippets.

View kbond's full-sized avatar

Kevin Bond kbond

View GitHub Profile
@somidad
somidad / workflow.yml
Last active June 23, 2023 14:06
GitHub Workflow to check any change on git repository and do something if any
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#environment-files
- name: Check if there is any change
id: get_changes
# deprecated. see https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
#run: echo "::set-output name=changed::$(git status --porcelain | wc -l)"
run: echo "changed=$(git status --porcelain | wc -l)" >> $GITHUB_OUTPUT
- name: Do something if there is any change
if: steps.get_changes.outputs.changed != 0
run: do something
@davidpiesse
davidpiesse / tailwind_md_all_colours.js
Last active April 5, 2024 14:55
A colour set for Tailwind CSS that include all Material Design Colours, shades, accents and contrast colours
// https://davidpiesse.github.io/tailwind-md-colours/
//
//Notes
//
//All colours are generated from Material Design Docs
//Colours have a base, a set of shades (50-900) accent colours
//In addition a companion set of contrast colours are included for colouring text / icons
// Example usage
// class="w-full bg-red-600 text-red-600-constrast"
@davidpiesse
davidpiesse / tailwind_md_colours.js
Last active November 30, 2020 21:35
Replace the default (still great) colors from Tailwind to those from Material Design maintaining the Tailwind naming convention
//Notes
//
//For mapping the 100-900 colors we have mapped as follows:
//darkest:900
//darker:700
//dark:600
//base:500
//light:400
//lighter:300
//lightest:100
@adamwathan
adamwathan / promise-take-at-least.js
Last active February 26, 2023 14:25
Promise.takeAtLeast
// Creates a new promise that automatically resolves after some timeout:
Promise.delay = function (time) {
return new Promise((resolve, reject) => {
setTimeout(resolve, time)
})
}
// Throttle this promise to resolve no faster than the specified time:
Promise.prototype.takeAtLeast = function (time) {
return new Promise((resolve, reject) => {
@weaverryan
weaverryan / README.md
Last active April 28, 2020 14:07
Symfony Core Meeting Logs
Date Topics URL Summary
May 21st, 2015 core team organization, issue tagging/organization, PSR-7 logs --
June 4th, 2015 PSR-HttpFoundation, DI-PSR, issue triaging/organization, meeting organization logs --
June 18th, 2015 workflow/notifications, removing forums/ML, 3.0 changes - templating logs --
July 2nd, 2015 issues bot / HttpFoundation PSR-7 / dropping templating / new SE structure/ config component split / HttpKernel split logs summary
July 16th, 2015 issues bot / updates on initiatives / closing old issues logs --
July 30th, 2015 deprecatio
@RuGa
RuGa / massInsertOrUpdate.php
Last active April 12, 2024 16:54
Mass (bulk) insert or update on duplicate for Laravel 4/5
/**
* Mass (bulk) insert or update on duplicate for Laravel 4/5
*
* insertOrUpdate([
* ['id'=>1,'value'=>10],
* ['id'=>2,'value'=>60]
* ]);
*
*
* @param array $rows
anonymous
anonymous / main.js
Created November 25, 2013 10:17
reload sf2 wdt on ajax request
$(document).ajaxComplete(function(event, XMLHttpRequest){
var token = XMLHttpRequest.getResponseHeader('x-debug-token'),
protocol = window.location.protocol,
hostname = window.location.hostname;
if(token) {
$.get(protocol+'//'+hostname+'/_wdt/'+token, function(data){
@jimbojsb
jimbojsb / nav-list.less
Last active February 6, 2018 21:57
.nav-list for Bootstrap 3.0
.nav-list {
padding-left: 15px;
padding-right: 15px;
margin-bottom: 0;
}
.nav-list > li > a,
.nav-list .nav-header {
margin-left: -15px;
margin-right: -15px;
@JCook21
JCook21 / composer.bat
Created February 6, 2012 14:02
Quick Batch file to add a 'composer' command to windows.
@echo off
if "%PHPBIN%" == "" set PHPBIN=C:\path\to\PHP\executable\dir\.\php.exe
"%PHPBIN%" "C:\path\to\composer.phar" %*
@kbond
kbond / post.md
Created June 8, 2011 19:59
Mount a shared folder automatically in Ubuntu with VirtualBox

Edit your /etc/fstab:

sudo nano /etc/fstab

Add the following:

[NAME]             [MOUNT_POINT]        vboxsf  rw              0       0

Where [NAME] is the name setup in the virtual machine settings and [MOUNT_POINT] is the path in the guest OS (Ubuntu) you want the shared folder located.