Skip to content

Instantly share code, notes, and snippets.

@senorihl
senorihl / README.md
Last active November 24, 2023 09:43
Clean and rebuild local staging branches

Bash script to clean & rebuild local staging branches

Installation

wget https://gist.githubusercontent.com/senorihl/637430191235b5362a27a8c785f9623c/raw/03c206bb0c8cecaff50325dfd170d913d1d97f6e/clean-staging-branch.sh -O $HOME/.clean-staging-branch.sh
chmod a+x $HOME/.clean-staging-branch.sh
git config --global alias.clean-staging '!bash $HOME/.clean-staging-branch.sh'
@FrikkieSnyman
FrikkieSnyman / readme.md
Last active June 24, 2023 08:06
GrapesJS - attributes, classes, and scripts

GrapesJS - attributes, classes, and scripts

Attributes

In order to add custom attributes to an HTML element that is generated by GrapesJS, one can simply make use of traits. For example, if you wish to produce an HTML element which contains the tag data-noout, a trait with the name data-noout can be added to a custom component.

    var domComps = editor.DomComponents;
    var dType = domComps.getType('default');
 var dModel = dType.model;
@lee2sman
lee2sman / bash_cheatsheet.md
Last active June 23, 2022 16:35
bash scripting cheatsheet

Bash scripting cheatsheet

  • by Lee2sman
  • Updated 2017-09-18

Bash shebang

  • #!/usr/bin/env bash for portability, or less good, #!/bin/bash

Commenting

@juanibrex
juanibrex / Pencil Project Hotkeys
Last active August 17, 2020 14:34
Pencil Project Shortcuts
# Pencil Project Shortcuts
## General Shortcuts
+ New Document: Ctrl + n
+ Open: Ctrl + o
+ Save: Ctrl + s
+ Save as: Ctrl + Shift + s
+ Export: Ctrl + Shift + e
+ Print: Ctrl + p
@brunob
brunob / cleanrss.html
Last active February 8, 2017 18:07
Un squelette SPIP qui prend l'url d'un flux RSS non valide en paramètre pour renvoyer le flux au propre. Pratique pour syndiquer certains flux WordPress (odgprod par exemple) dans Nextcoud. https://seenthis.net/messages/568088
#CACHE{0}
[(#HTTP_HEADER{Content-type: text/xml[; charset=(#CHARSET)]})]<?xml
version="1.0"[ encoding="(#CHARSET)"]?>
<rss version="2.0" [(#REM) rss 2.0.9)]
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
>
[(#SET{channel,#ENV{url}|analyser_site})]
<channel[ xml:lang="(#LANG)"]>
[<title>(#GET{channel}|table_valeur{nom_site}|textebrut|texte_backend)</title>]
@kevinpapst
kevinpapst / osx-10.11-setup.md
Last active April 28, 2024 05:26 — forked from kevinelliott/osx-10.11-setup.md
Mac OS X 10.11 El Capitan Setup

Developer setup for Mac OS X 10.11 El Capitan

Inspired by a Gist from kevinelliott - thanks!

Software

Install from App Store

  • Xcode - for command line tools required by Homebrew
@thegitfather
thegitfather / vanilla-js-cheatsheet.md
Last active May 6, 2024 14:31
Vanilla JavaScript Quick Reference / Cheatsheet

1. Create a folder in Dropbox or Google Drive

We'll use ~/Dropbox/Macnotes in this example

2. Copy the notes folder to the new folder in Dropbox or Google Drive

We'll use Finder for this instead of terminal as the cp -r command also copies the contents of all aliases and the Notes folder has a lot of those. Quit notes Open terminal and enable hidden files in Finder:

defaults write com.apple.finder AppleShowAllFiles YES.
@ryantbrown
ryantbrown / gulp-resize-and-minify-images.js
Last active August 30, 2022 14:07
Gulp - Resize and Optimize / Minify Images
/**
* Make sure Graphicsmagick is installed on your system
* osx: brew install graphicsmagick
* ubuntu: apt-get install graphicsmagick
*
* Install these gulp plugins
* glup, gulp-image-resize, gulp-imagemin and imagemin-pngquant
*
* Group images according to their output dimensions.
* (ex: place all portfolio images into "images/portfolio"
// Photoshop Script to Create iPhone Icons from iTunesArtwork
// Original: https://gist.github.com/appsbynight/3681050
// Turn debugger on. 0 is off.
// $.level = 1;
try
{
// Prompt user to select iTunesArtwork file. Clicking "Cancel" returns null.
var iTunesArtwork = File.openDialog("Select a sqaure PNG file that is at least 1024x1024.", "*.png", false);