Skip to content

Instantly share code, notes, and snippets.

@l2zeo
l2zeo / cloudSettings
Created September 4, 2022 10:05
Visual Studio Code Settings Sync Gist
// Empty
@l2zeo
l2zeo / example.com
Created October 5, 2019 10:01 — forked from 1hakr/example.com
Supercharge your NGIX config
proxy_cache_path /tmp/cacheapi levels=1:2 keys_zone=microcacheapi:100m max_size=1g inactive=1d use_temp_path=off;
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
server_name example.com;
location /api/ {
# Rate Limiting
limit_req zone=reqlimit burst=20; # Max burst of request
@l2zeo
l2zeo / mysql-drop-all-tables.sh
Created October 1, 2019 14:57 — forked from cweinberger/mysql-drop-all-tables.sh
drops all tables of a specific db
#!/bin/bash
#usage: mysql-drop-all-tables -d database -u dbuser -p dbpass
TEMP_FILE_PATH='./drop_all_tables.sql'
while getopts d:u:p: option
do
case "${option}"
in
@l2zeo
l2zeo / README.md
Last active September 3, 2019 14:46 — forked from roachhd/README.md
Ode To Dan : Quick switch Themes with javascript

A simple clone of Dan Edens' blog with the day/night persistent toggle ❤️

<script>
// Toggle night theme
var d = document.documentElement,
    t = document.querySelectorAll(".js--toggle-lights")[0],
    m = localStorage.getItem("nightmode");

if(m == "true") {
@l2zeo
l2zeo / example.html
Created August 22, 2019 05:32 — forked from nu7hatch/example.html
Simple banner rotator with jQuery
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
<link href="rotate.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="rotate.js"></script>
<script type="text/javascript">
$(window).load(function() {
startRotator("#rotator");
})
</script>
@l2zeo
l2zeo / index.html
Created July 22, 2019 13:28 — forked from CodeBrauer/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 ;)
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->