Skip to content

Instantly share code, notes, and snippets.

View Trusted97's full-sized avatar
🎯
Focusing

Gianluca Benucci Trusted97

🎯
Focusing
View GitHub Profile
#!/bin/bash
# Rick Astley in your Terminal.
# I'm bored
version='1.1'
rick='http://keroserene.net/lol'
video="$rick/astley80.full.bz2"
audio_gsm="$rick/roll.gsm"
audio_raw="$rick/roll.s16"
audpid=0
@Trusted97
Trusted97 / gtm.tampermonkey.js
Created September 20, 2019 09:32 — forked from walkergv/gtm.tampermonkey.js
Adding GTM (Google Tag Manager) Container Code using Tampermonkey
// ==UserScript==
//@name Name of your script
//@namespace http://use.i.E.your.homepage/
//@version 0.1
//@description Inject GTM bootstrap on my website
//@include http://www.domain.com/* [wildcard url where GTM should inject the code]
// ==/UserScript==
// Google Tag Manager
setTimeout("(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':"+
@Trusted97
Trusted97 / facebook-wca-standard-events.html
Created September 26, 2019 13:38 — forked from danieljwonder/facebook-wca-standard-events.html
Sample Facebook Standard Events for New Facebook WCA (Website Custom Audience) Pixel
<!-- Facebook Custom Audience Pixel Code - Placed on Every Page of Site -->
<script>
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
document,'script','//connect.facebook.net/en_US/fbevents.js');
fbq('init', '{{facebook pixel}}');
fbq('track', 'PageView');
</script>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Webpage",
"url": "https://www.example.com",
"name": "My Webpage",
"headline": "webpage title",
"description": "Here is the description",
"mainEntityOfPage": {
"@type": "WebPage",
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "NewsArticle",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "https://google.com/article"
},
"headline": "Article headline",
"image": [
(function(document) {
var referrer = document.referrer;
var gaReferral = {
'utmcsr': '(direct)',
'utmcmd': '(none)',
'utmccn': '(not set)'
};
var thisHostname = document.location.hostname;
var thisDomain = getDomain_(thisHostname);
@Trusted97
Trusted97 / MySQL CLI Cheatsheet
Created January 2, 2020 13:38 — forked from hofmannsven/README.md
MySQL CLI Cheatsheet
# MySQL
## Getting started
- http://www.sqlteaching.com/
- https://www.codecademy.com/learn/learn-sql
### Related tutorials
- [MySQL-CLI](https://www.youtube.com/playlist?list=PLfdtiltiRHWEw4-kRrh1ZZy_3OcQxTn7P)
- [Analyzing Business Metrics](https://www.codecademy.com/learn/sql-analyzing-business-metrics)
- [SQL joins infografic](https://www.codeproject.com/Articles/33052/Visual-Representation-of-SQL-Joins)
@Trusted97
Trusted97 / .htaccess
Created January 17, 2020 16:48 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@Trusted97
Trusted97 / service-worker.js
Created November 2, 2020 09:23
PreFetch URL Service Worker
/*
Copyright 2014 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
@Trusted97
Trusted97 / async-all.js
Created November 9, 2020 09:34
Cool way for loading script in async for every browser
!function(e,t,r){function n(){for(;d[0]&&"loaded"==d[0][f];)c=d.shift(),c[o]=!i.parentNode.insertBefore(c,i)}for(var s,a,c,d=[],i=e.scripts[0],o="onreadystatechange",f="readyState";s=r.shift();)a=e.createElement(t),"async"in i?(a.async=!1,e.head.appendChild(a)):i[f]?(d.push(a),a[o]=n):e.write("<"+t+' src="'+s+'" defer></'+t+">"),a.src=s}(document,"script",[
"//other-domain.com/1.js",
"2.js"
])