Skip to content

Instantly share code, notes, and snippets.

View ahmadalibaloch's full-sized avatar
🎯
Focusing

Ahmad Ali ahmadalibaloch

🎯
Focusing
View GitHub Profile
@faustinoaq
faustinoaq / myAngular.html
Last active March 2, 2025 19:07
Front-end libraries (React, Vue, Angular) and the basic principles of how they work, all in a single file using pure JavaScript (VanillaJS).
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Angular from Scratch</title>
<style>
.my-component {
font-family: Arial, sans-serif;
@thomasdarimont
thomasdarimont / app.py
Last active December 29, 2024 14:59
Example for a simple Python flask webapp that uses Authlib to act as an OpenID Connect client for Keycloak
import json
import os
import certifi
import requests
from authlib.oauth2.rfc6749 import OAuth2Token
from flask import Flask, url_for, session
from flask import render_template, redirect
from authlib.integrations.flask_client import OAuth, token_update
@wiverson
wiverson / modern-hosting-2021.md
Last active June 6, 2024 20:15
List of free hosting services (that also offer options to scale up for $) in 2021

Italics means the text/description is directly from the vendor, usually the slug line on their home page.

Non-italics means it's my comments/editorial.

Static Sites

  • Surge
    • Static web publishing for Front-End Developers
    • Simple, single-command web publishing. Publish HTML, CSS, and JS for free, without leaving the command line.
@AnatomicJC
AnatomicJC / android-backup-apk-and-datas.md
Last active March 2, 2025 21:02
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

Note: This gist may be outdated, thanks to all contributors in comments.

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Don't hesitate to read comments, there is useful tips, thanks guys for this !

@ahmadalibaloch
ahmadalibaloch / customSetTimeoutAndsetInterval.js
Last active December 7, 2022 07:34
custom setTimeout and setInterval for sandbox environments in browsers (vm-browserify or node-vm)
const setTimeouts = [];
export function customSetTimeout(cb, interval) {
const now = window.performance.now();
const index = setTimeouts.length;
setTimeouts[index] = () => {
cb();
};
setTimeouts[index].active = true;
const handleMessage = (evt) => {
if (evt.data === index) {
@btroncone
btroncone / ngrxintro.md
Last active January 24, 2025 10:03
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

Comprehensive Introduction to @ngrx/store

By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

@tikolakin
tikolakin / fish_alias.md
Last active February 17, 2025 10:33
Create alias in Fish shell and save this as a permanent function

Directly from CLI

alias x='exit'
funcsave x

or create a file in

~/.config/fish/functions 

with name

@jgilfelt
jgilfelt / CurlLoggingInterceptor.java
Created January 9, 2016 15:34
An OkHttp interceptor that logs requests as curl shell commands
/*
* Copyright (C) 2016 Jeff Gilfelt.
*
* 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
@yqritc
yqritc / gist:ccca77dc42f2364777e1
Last active January 25, 2025 17:43
Equal column spacing for Android RecyclerView GridLayoutManager by using custom ItemDecoration

ItemOffsetDecoration

public class ItemOffsetDecoration extends RecyclerView.ItemDecoration {

    private int mItemOffset;

    public ItemOffsetDecoration(int itemOffset) {
        mItemOffset = itemOffset;
    }
@renestalder
renestalder / README.md
Last active February 6, 2025 09:56
Unfollow all on Facebook

Facebook: Unfollow people and pages

See comments section for more up-to-date versions of the script. The original script is from 2014 and will not work as is.

  1. Open news feed preferences on your Facebook menu (browser)
  2. Click people or pages
  3. Scroll down (or click see more) until your full list is loaded
  4. Run the script in your browser console

Facebook will block this feature for you while you use it, depending on how much entities you try to unfollow. It automatically unblocks in a couple of hours and you will be able to continue.