Skip to content

Instantly share code, notes, and snippets.

// Place your settings in the file "Packages/User/Preferences.sublime-settings",
// which overrides the settings in here.
//
// Settings may also be placed in syntax-specific setting files, for
// example, in Packages/User/Python.sublime-settings for python files.
{
// Sets the colors used within the text area
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
// Note that the font_face and font_size are overridden in the platform
@CodeBrauer
CodeBrauer / Default (OSX).sublime-keymap
Created June 21, 2017 07:41 — forked from mjleino/Default (OSX).sublime-keymap
Banish non-breaking spaces from Sublime Text
// Preferencs -> Key Bindings – User
[
{
"keys": ["alt+space"],
"command": "insert",
"args": { "characters": " "}
}
]
{
// If plugin has trouble finding Node.js, replace this string with path
// to your `node` bin
"node-path" : ":/usr/local/bin",
// Full list of supported options and acceptable values can be found here:
// https://github.com/csscomb/csscomb.js/blob/master/doc/options.md
"config": {
// Whether to add a semicolon after the last value/mixin.
@CodeBrauer
CodeBrauer / mount-image-qcow2-from-kvm-on-macos.md
Last active April 17, 2022 09:24
Mount image (qcow2) from KVM on macOS - fastest way? / Convert qcow2 to access files (EXT4 partition)

If you haven't installed any FUSE yet:

brew tap homebrew/fuse
brew install Caskroom/cask/osxfuse
  1. brew install qemu ext4fuse
  2. qemu-img convert -p -O vmdk snapshot.qcow2 system.vmdk This will take some time...
  3. Download and register for a free licence of VMDK Mounter for Mac® OS X and install it.
  4. Reboot your macOS device.
@CodeBrauer
CodeBrauer / composer.json
Last active August 15, 2018 13:34
Get all snapshots from archive.org as list
{
"require": {
"fabpot/goutte": "^3.2",
"digitalnature/php-ref": "^1.2"
}
}
@CodeBrauer
CodeBrauer / gist:b938983729c024ad6ab81b1ee7e2f1ed
Last active November 16, 2016 15:32 — forked from mikejolley/gist:1604009
WooCommerce - Add a special field to the checkout, order emails and user/order meta
<?php
/**
* Add the field to the checkout
**/
add_action('woocommerce_after_order_notes', 'my_custom_checkout_field');
function my_custom_checkout_field( $checkout ) {
echo '<div id="my_custom_checkout_field"><h3>'.__('My Field').'</h3>';
<?php
$urls = [
'http://www.flickr.com/services/feeds/photos_public.gne',
'https://i.stack.imgur.com/fgwQf.jpg',
'https://api.wordpress.org/secret-key/1.1/salt/',
'http://gabrielw.de',
'https://google.com',
'https://raw.githubusercontent.com/CodeBrauer/gmod-loadingscreen/master/img/bg.jpg',
];
@CodeBrauer
CodeBrauer / index.html
Created November 9, 2016 11:19 — forked from anonymous/index.html
Style visited links with localStorage
<div class="wrap">
<h1>Style visited links with localStorage</h1>
<h2>Why?</h2>
<p>
Since browsers allow only very basic CSS on <code>:visited</code> I created this way to check a user has clicked a link. If he clicks on any link, that has the class <code>.trackVisit</code> the complete href is saved in an array in localStorage.
On each page visit and click on a link the script adds the class <code>.visited</code> so we can style it however we want.
</p>
<h2>Demo Links: Repo services</h2>
<p>
The links have <code>e.preventDefault();</code> - so you can click them hassle free ;)
@CodeBrauer
CodeBrauer / load.php
Last active February 8, 2017 11:43
get server % load (debian) in php
<?php
$load = str_replace(',','.', trim(`uptime| awk '{print $10 }'`));
$cores = trim(`lscpu | grep "CPU(s):" | awk '{print $2}' | head -1`);
$percent = $load/$cores * 100;
echo $percent . '%';
@CodeBrauer
CodeBrauer / blur.php
Last active June 16, 2016 08:54
Blur image dynamically
<?php
/**
* Strong Blur
*
* @param resource $gdImageResource
* @param int $blurFactor optional
* This is the strength of the blur
* 0 = no blur, 3 = default, anything over 5 is extremely blurred
* @return GD image resource