Skip to content

Instantly share code, notes, and snippets.

@leoheck
leoheck / fix-ubuntu-18.10-on-dell-xps-9570
Last active Nov 7, 2019
Fix Ubuntu 18.10 on Dell XPS 9570
View fix-ubuntu-18.10-on-dell-xps-9570
#
# Run this from the Live USB.
#
#############################
# EDIT YOUR PARTITIONS HERE #
#############################
root_partition=/dev/nvm0n1p2
sudo mount ${root_partition} /mnt
@mpryvkin
mpryvkin / beautify-html.js
Last active Aug 6, 2020 — forked from brnpimentel/beautify-html.js
JS Beautify hack to work with Blade directives (Laravel)
View beautify-html.js
function Beautifier(html_source, options, js_beautify, css_beautify) {
//Wrapper function to invoke all the necessary constructors and deal with the output.
html_source = html_source || '';
// BEGIN
html_source = html_source.replace(/\{\{((?:(?!\}\}).)+)\}\}/g, function (m, c) {
if (c) {
c = c.replace(/(^[ \t]*|[ \t]*$)/g, '');
c = c.replace(/'/g, ''');
c = c.replace(/"/g, '"');
@brnpimentel
brnpimentel / beautify-html.js
Created Dec 18, 2017
JS Beautify hack to works with blade directives (laravel)
View beautify-html.js
function style_html(html_source, options, js_beautify, css_beautify) {
html_source = html_source.replace(/\@([^\n\s]*)/ig, "<blade $1/>");
...
sweet_code = sweet_code.replace(/<blade ([^\n]*)\/>/ig, "@$1");
sweet_code = sweet_code.replace(/\(\ \'/ig, "('");
...
@Efreak
Efreak / startwsl.vbs
Created Nov 25, 2016
Start persistent WSL with services and byobu in background. To launch byobu with wsltty, use the command in wsl.bat, and replace /bin/bash with /usr/bin/byobu. Raw
View startwsl.vbs
'syntax
' - Run: http://ss64.com/vb/run.html or https://msdn.microsoft.com/en-us/library/d5fk67ky(v=vs.84).aspx
' - Sleep: http://ss64.com/vb/sleep.html or https://msdn.microsoft.com/en-us/library/6t81adfd(v=vs.84).aspx
'start hidden byobu in WSL. If you like playing with zsh modules so much that your prompt frequently takes a long time to load, you'll want this.
CreateObject ("Wscript.Shell").Run "C:\Windows\System32\bash.exe -c byobu", 0, false
'give it a bit to finish starting. https://msdn.microsoft.com/en-us/library/6t81adfd(v=vs.84).aspx
WScript.Sleep(3000)
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active Jan 20, 2022
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)
View iterm2-solarized.md

Default

Default

Powerlevel10k

Powerlevel10k

@BeingTomGreen
BeingTomGreen / Laravel 4 hostname environment detection
Created Dec 11, 2013
A quick way of reinstating the older Laravel 4 environment detection. As of 4.1 host name based environment detection has been removed due to security concerns, but some people may wish to add this back in. See more here: https://github.com/laravel/framework/commit/02618b4190c08e1fe6e138eadb95473c92da6718
View Laravel 4 hostname environment detection
<?php
// An array of environments, exactly as old syntax
$envs = [
'local' => ['Alex','Al', 'Tom-PC', 'Tom', 'mgc.dev'],
'local_mamp' => ['navi-mini.home', 'aaron-whiffins-mac-mini.home'],
'production' => ['mygiftclues.com'],
'staging' => ['giftclue.co.uk']
];