Skip to content

Instantly share code, notes, and snippets.

@rlaphoenix
rlaphoenix / btn-site-tags.md
Last active May 5, 2024 20:19
BTN Site Tags
Site/Network Abbreviation
9Now 9NOW
A&E AE
ABC (AU) iView AUBC
ABC (US) AMBC
Adult Swim AS
Al Jazeera English AJAZ
All4 (Channel 4, ex-4oD) ALL4
Amazon AMZN
@navarrothiago
navarrothiago / README.md
Last active May 5, 2024 20:19
Turn your smartphone or tablet camera into a WebCam to make video conference in Linux
@rishavpandey43
rishavpandey43 / git-commit-styleguide.md
Last active May 5, 2024 20:14
This gist consist of the rules and best practice of good conventional git commit message

Git Commit Messages Style-Guides

  • Use the present tense ("Add feature" not "Added feature")
  • Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
  • Limit the first line to 72 characters or less
  • Reference issues and pull requests liberally after the first line
  • When only changing documentation, include [ci skip] in the commit title
  • Consider starting the commit message with an applicable emoji

Types

using R3;
// Action<T1, T2> -> Observable<(T1, T2)>
public class Foo
{
event Action<int, string> OnFoo;
public Observable<(int, string)> OnFooAsObservable()
{
@ManUtopiK
ManUtopiK / clean-graphql.js
Last active May 5, 2024 20:11
Clean graphql response : Remove edges, node and __typename from graphql response
/**
* Remove edges, node and __typename from graphql response
*
* @param {Object} input - The graphql response
* @returns {Object} Clean graphql response
*/
const cleanGraphQLResponse = function(input) {
if (!input) return null
const output = {}
const isObject = obj => {
@mcrumm
mcrumm / component_under_test.ex
Last active May 5, 2024 20:07
Testing Phoenix.LiveComponent in Isolation
# lib/party_web/components/example_component.ex
defmodule PartyWeb.ExampleComponent do
@moduledoc """
An example LiveComponent under test.
"""
use Phoenix.LiveComponent
def render(assigns) do
~H"""
<div>
@SurajValluru
SurajValluru / HomeFragment.kt
Created May 5, 2024 20:06 — forked from preetham1316/HomeFragment.kt
Sticky Header with Click Listeners for Recycler View
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.LinearLayoutManager
import com.example.stickyheader.databinding.FragmentHomeListBinding
import com.example.stickyheader.header.StickyHeaderItemDecorator
import com.example.stickyheader.model.ItemModel
@EvgenyOrekhov
EvgenyOrekhov / A simple Docker and Docker Compose install script for Ubuntu.md
Last active May 5, 2024 20:06
A simple Docker and Docker Compose install script for Ubuntu

A simple Docker and Docker Compose install script for Ubuntu

Usage

  1. sh install-docker.sh
  2. log out
  3. log back in

Links

function calculate_median($arr) {
$count = count($arr); //total numbers in array
$middleval = floor(($count-1)/2); // find the middle value, or the lowest middle value
if($count % 2) { // odd number, middle is the median
$median = $arr[$middleval];
} else { // even number, calculate avg of 2 medians
$low = $arr[$middleval];
$high = $arr[$middleval+1];
$median = (($low+$high)/2);
}
#!/bin/bash
# sudo apt install jq wget curl
# usage: github-install user/repo
set -e
repo=$1
tmp="/tmp/.github-install"
binpath="$HOME/.local/bin"
rm -rf $tmp