Skip to content

Instantly share code, notes, and snippets.

View valeryan's full-sized avatar

Samuel Hilson valeryan

View GitHub Profile
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active April 22, 2024 01:47
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@leoheck
leoheck / fix-ubuntu-18.10-on-dell-xps-9570
Last active December 17, 2022 11:11
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
@Efreak
Efreak / startwsl.vbs
Created November 25, 2016 20:40
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
'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)
@mpryvkin
mpryvkin / beautify-html.js
Last active August 6, 2020 15:46 — forked from brnpimentel/beautify-html.js
JS Beautify hack to work with Blade directives (Laravel)
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 December 18, 2017 13:37
JS Beautify hack to works with blade directives (laravel)
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, "('");
...
@BeingTomGreen
BeingTomGreen / Laravel 4 hostname environment detection
Created December 11, 2013 16:40
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
<?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']
];