Skip to content

Instantly share code, notes, and snippets.

View Illyism's full-sized avatar
🚀

Ilias Ism Illyism

🚀
View GitHub Profile
@Illyism
Illyism / posthog-avg-time.sql
Last active August 10, 2023 21:08
How to get average time on page in PostHog - https://gradient.page example
/*
https://twitter.com/illyism/status/1689679677563006976
Shared for gradient.page: https://eu.posthog.com/shared/xTSSqCWgGVUnhselqI_YOoxGVPtlWQ
Modify it by settings your domain below
*/
SELECT
avg(time_on_page) AS avg_time_on_page,
count(time_on_page) AS counts,
─────────────────────────────────────
─────────▄███████████▄▄──────────────
──────▄██▀──────────▀▀██▄────────────
────▄█▀────────────────▀██───────────
──▄█▀────────────────────▀█▄─────────
─█▀──██──────────────██───▀██────────
█▀──────────────────────────██───────
█──███████████████████───────█───────
█────────────────────────────█───────
█────────────────────────────█───────
@Illyism
Illyism / AutoHotKey
Created December 21, 2013 13:01
AutoHotKey configuration for running cmder, sublime text and Gmail.
; Ctrl+Alt+T - Run Command Line
^!t::
SetWorkingDir, C:\Tools\cmder
Run Cmder.bat
Return
; Win+Z - Run Sublime Text
#z::
Run "C:\Program Files\Sublime Text 3\sublime_text.exe"
Return
@Illyism
Illyism / bench.sh
Created October 10, 2013 18:02
Benchmark for linux. Perfect for VPS. CPU, RAM, SWAP, uptime, download speedtest, I/O
#!/bin/bash
cname=$( awk -F: '/model name/ {name=$2} END {print name}' /proc/cpuinfo )
cores=$( awk -F: '/model name/ {core++} END {print core}' /proc/cpuinfo )
freq=$( awk -F: ' /cpu MHz/ {freq=$2} END {print freq}' /proc/cpuinfo )
tram=$( free -m | awk 'NR==2 {print $2}' )
swap=$( free -m | awk 'NR==4 {print $2}' )
up=$(uptime|awk '{ $1=$2=$(NF-6)=$(NF-5)=$(NF-4)=$(NF-3)=$(NF-2)=$(NF-1)=$NF=""; print }')
echo "CPU model : $cname"
@Illyism
Illyism / Remove All Missing Links
Created May 15, 2013 14:11
It removes all the missing links and keeps the frames.
@Illyism
Illyism / gist:3552285
Created August 31, 2012 12:47
Folder Creation On Tabs.
var bStrm = new ActiveXObject("Adodb.Stream");
var wShell = new ActiveXObject("Wscript.Shell");
var fso = new ActiveXObject("Scripting.FileSystemObject");
var ForReading = 1, ForWriting = 2, ForAppending = 8;
var TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0;
var debug = false;
if (typeof XMLHttpRequest == "undefined")
XMLHttpRequest = function () {
try { return new ActiveXObject("Msxml2.XMLHTTP.6.0"); }
catch (e) {}
try { return new ActiveXObject("Msxml2.XMLHTTP.3.0"); }
catch (e) {}
try { return new ActiveXObject("Msxml2.XMLHTTP"); }
catch (e) {}
//Microsoft.XMLHTTP points to Msxml2.XMLHTTP.3.0 and is redundant
throw new Error("This browser does not support XMLHttpRequest.");
@Illyism
Illyism / wikiHow userscript
Created August 3, 2010 11:40
An userscript/greasemonkey script for wikiHow
// ==UserScript==
// @name wikiHow Plus
// @namespace http://www.wikihow.com
// @description Does nifty stuff on wikiHow, like autowelcome.
// @include http://*wikihow.com/*
// @version 0.2
// ==/UserScript==
// Options:
// - Plus -
@Illyism
Illyism / PSD to HTML slicer
Created August 3, 2010 11:37
Creates a HTML file from Photoshop layers.
/*
Create HTML
Code: Ilias Ismanalijev
Arlo Rose
*/
var isCS2 = (app.version.split(".")[0] > 8) ? true : false;
var nonNormalAlert = false;
function makeDialog(htmlInfo)
{