Skip to content

Instantly share code, notes, and snippets.

@schacon
schacon / better-git-branch.sh
Created January 13, 2024 18:41
Better Git Branch output
#!/bin/bash
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
NO_COLOR='\033[0m'
BLUE='\033[0;34m'
YELLOW='\033[0;33m'
NO_COLOR='\033[0m'
@oskosk
oskosk / README.md
Last active December 10, 2018 15:47
  1. Create a JN site with ?gutenberg&jetpack
  2. SSH into it.
  3. Run curl https://gist.githubusercontent.com/oskosk/1b821e70548b065cef1d9c8e6f786089/raw/build-gutenpack.sh --output build-gutenpack.sh && source build-gutenpack.sh
  4. Check the Gutenberg demo page and confirm that the Markdown block is present on the Inserter.
@blowery
blowery / a.mjs
Last active January 5, 2024 15:37
cycles in es6
const namer = "hanz";
export default namer;
import b from './b';
console.log( 'starting a' );
function combo() {
return b + 'a';
}
@tyxla
tyxla / gist:1685d1a60595ab6bd717abbafa3368e4
Created October 4, 2017 07:14
Remove empty lines between ES6 imports recursively in a directory (using multiline regex find and replace with perl)
find . -type f -exec perl -0777 -i -p -e 's/(import[^\n\r]+)[\n\r]{2,}(import[^\n\r]+)/\1\n\2/igs' {} +
@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active July 4, 2024 01:11
Hyperlinks in Terminal Emulators
@sirreal
sirreal / README.md
Last active November 15, 2022 22:25
node-sass inline svgs via `svg()` function

Make it easy to include SVG strings inline via node-sass.

Escapes SVG (via encodeURIComponent + node-sass custom function).

Wraps <svg/> with appropriate url(data...) which I can never remember.

Call:

node-sass --source-map=true --functions=./node-sass-functions.js in.scss out.css
@jaredly
jaredly / inner.html
Created February 2, 2015 16:43
Demonstrate react devtools from inner frame
<script>
__REACT_DEVTOOLS_GLOBAL_HOOK__ = parent.__REACT_DEVTOOLS_GLOBAL_HOOK__
</script>
<script src="vendor.js"></script>
<script>
window.React = parent.React = require('react')
window.onload = function() {
React.render(React.createElement('strong', null, 'hello'), document.body)
}
</script>
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!--
Documented at
http://linux.die.net/man/5/fonts-conf
To check font mapping run the command at terminal
$ fc-match 'helvetica Neue'