Skip to content

Instantly share code, notes, and snippets.

View azulkipli's full-sized avatar

azulkipli azulkipli

View GitHub Profile
@azulkipli
azulkipli / Nework_throttling_profiles.md
Created June 11, 2022 13:46 — forked from theodorosploumis/Nework_throttling_profiles.md
Web development - Custom network throttling profiles
Profile download (kb/s) upload (kb/s) latency (ms)
Native 0 0 0
GPRS 50 20 500
56K Dial-up 50 30 120
Mobile EDGE 240 200 840
2G Regular 250 50 300
2G Good 450 150 150
3G Slow 780 330 200
@azulkipli
azulkipli / osxdaily-adsense-remover.user.js
Last active December 1, 2019 17:39
osxdaily-adsense-remover
// ==UserScript==
// @name osxdaily-ads-remover
// @namespace az
// @include http://osxdaily.com/*
// @version 0.1.0
// @grant none
// @author azul
// @description remove ads on osxdaily.com
// ==/UserScript==
@azulkipli
azulkipli / gist:df4ccab7a343438a0dcab49f18a2c58f
Last active February 13, 2019 11:30
alias script to backup & rsync remote folder
# alias backup
alias backup-appname='ssh -i ~/path_to/sshkey.pem user@ip_address "tar jcfv /fullpath_server_directory/filename-`date +%F.%H%M`.tar.bz2 /fullpath_server_directory/app_directory"'
# alias rsync
alias rsync-appname='rsync -a -e "ssh -i /local_fullpath_to/sshkey.pem -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" -rz --progress --delete-after /local_fullpath_to/app_directory/ user@ip_address:/fullpath_server_directory/app_directory/'
<?php
class Pipeline
{
public static function make_pipeline(...$funcs)
{
return function($arg) use ($funcs)
{
# calling each function in the make_pipeline in order
foreach($funcs as $function) {
# Store the triggering value in first function of args
<?php
class Palindrome
{
public static function isPalindrome($word)
{
$str = strtolower($word);
if ($str == strrev($str))
return TRUE;
else
select name from employees where id not in (select managerId from employees m where managerId is not null)
-- ref: https://sqliteonline.com/#fiddle-5c2f897f7180djmyjqi96d0a
SELECT COUNT(*) FROM students WHERE firstName='John';
function appendChildren(decorateDiv) {
var allDivs = document.getElementsByTagName("div");
var numberOfDivs=allDivs.length;
for (var i = 0; i < numberOfDivs; i++) {
var newDiv = document.createElement("div");
decorateDiv(newDiv);
allDivs[i].appendChild(newDiv);
}
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Company page</title>
</head>
<body>
<p>Welcome! Here you can find the following things:</p>
<ol>
<li><a href="#logo"><em>Company's logo</em></a></li>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Avatar</title>
<style>
.avatar {
width: 150px;
height: 150px;