Skip to content

Instantly share code, notes, and snippets.

View alesvaupotic's full-sized avatar

Aleš Vaupotič alesvaupotic

View GitHub Profile
<link rel="import" href="../core-field/core-field.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../core-icons/core-icons.html">
<polymer-element name="my-element">
<template>
<style>
:host {
@alesvaupotic
alesvaupotic / gist:64d2e489ad663f844925c5a285e9dc23
Created October 12, 2017 17:47
Disable Ubuntu blanking the console
sudo nano /etc/default/grub
find & add consoleblank=0 to GRUB_CMDLINE_LINUX_DEFAULT="quiet splash consoleblank=0"
sudo update-grub
@alesvaupotic
alesvaupotic / gist:dd0c6d36ddd5c5e6104bec596d54699b
Created October 30, 2017 20:22
set cursor to the end of a field
q = document.getElementById('q');
setTimeout(function(){ q.selectionStart = q.selectionEnd = 10000; }, 0);
<p>Drag the following link into your Bookmarks Bar</p>
<a href="javascript:i=prompt('Search Laravel 7 Docs for');if(i)location.href='https://www.google.com/search?q=site:laravel.com/docs/7.x '+escape(i);">L7 Docs</a>
# DANGEROUS!
# Run only if you understand completely what you are doing.
# In your Powershell as Administrator prompt:
Get-AppxPackage -allusers | Remove-AppxPackage
@alesvaupotic
alesvaupotic / LXD setup
Created November 27, 2017 18:37
After setup, set ZFS compression for your poll and updates for LXD
#as sudo
zfs set compression=lz4 containers
zfs get compressratio containers
lxc config set images.auto_update_cached true
lxc config set images.remote_cache_expiry 1
lxc config set images.auto_update_interval 0
Open Command Prompt as Administrator
assoc .="No Extension"
ftype "No Extension"="C:\Program Files (x86)\Notepad++\notepad++.exe" "%1"
assoc "No Extension"\DefaultIcon=%SystemRoot%\System32\imageres.dll,-102
@alesvaupotic
alesvaupotic / LaravelActionBladeIfs.php
Last active June 30, 2018 09:26
Laravel Blade helpers for Actions in @included files
Blade::if('edit', function () {
return ( request()->route()->getActionMethod()==='edit');
});
Blade::if('create', function () {
return ( request()->route()->getActionMethod()==='create');
});
Blade::if('index', function () {
return ( request()->route()->getActionMethod()==='index');
<p>Drag the following link into your Bookmarks Bar</p>
<a href="javascript:i=prompt('Search Google for JS in last two years');if(i)location.href='https://www.google.com/search?q='+escape(i)+' -angular -vue -ember -react -jquery js javascript after:'+((new Date()).getFullYear()-2)+'-01-01';">JS</a>
@alesvaupotic
alesvaupotic / gist:5857edaf474756185924d73ebb4e0e91
Created December 30, 2020 14:26
Lose all commit history of a project
git init
git remote add origin git@github.com:USERNAME/REPOSITORY.git
git add *
git commit -am 'Init'
git push -f origin HEAD:main