Skip to content

Instantly share code, notes, and snippets.

Jonathan Kosgei jonathan-kosgei

Block or report user

Report or block jonathan-kosgei

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@marckohlbrugge
marckohlbrugge / unread_only.js
Created May 3, 2018
Hides all read chats so you only see unread chats. Save this as a bookmarklet with https://mrcoles.com/bookmarklet/ and run on https://web.telegram.org/#/im
View unread_only.js
$(".im_dialog_wrap .im_dialog_badge.ng-hide").each(function(index, el){$(el).parents("li.im_dialog_wrap").addClass("ng-hide");});
View notify.js
const mailgun = require('mailgun-js')({apiKey: api_key, domain: domain});
const twilio = new require('twilio')(accountSid, authToken);
export default function notify (to, msg, options) {
if (Array.isArray(to)) {
to.forEach((toSingle) => notify(toSingle, msg, options));
return;
}
if (to.includes("@")) {
@T1T4N
T1T4N / conditional_decorator.py
Last active Jan 11, 2019
Python conditional decorator
View conditional_decorator.py
class conditional_decorator(object):
def __init__(self, dec, condition):
self.decorator = dec
self.condition = condition
def __call__(self, func):
if not self.condition:
# Return the function unchanged, not decorated.
return func
return self.decorator(func)
@lcherone
lcherone / disposable-email-provider-domains
Last active Nov 21, 2019 — forked from michenriksen/disposable-email-provider-domains
List of disposable email provider domains
View disposable-email-provider-domains
0815.ru
0815.ru0clickemail.com
0815.ry
0815.su
0845.ru
0clickemail.com
0-mail.com
0wnd.net
0wnd.org
10mail.com
@jonathan-kosgei
jonathan-kosgei / docker_clean_ci.sh
Last active Jul 15, 2017
Delete all images in order of dependency excluding selected base images for faster builds
View docker_clean_ci.sh
#!/bin/bash
function list_include_item { local list="$1"; local item="$2"; if [[ $list =~ (^|[[:space:]])"$item"($|[[:space:]]) ]] ; then result=0; else result=1; fi; return $result;};
bases="alpine:latest nginx:1.11.3-alpine"
delete=
# append latest tag to each image
for item in $(docker images --format "{{.Repository}}:{{.Tag}}@{{.ID}}")
do
export IFS=' '
IFS='@'; arr=($item); unset IFS;
@rverton
rverton / chrome_headless_screenshot.py
Created Jul 10, 2017
Make a screenshot with a headless google chrome in python
View chrome_headless_screenshot.py
# Install chromedriver from https://sites.google.com/a/chromium.org/chromedriver/downloads
import os
from optparse import OptionParser
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
CHROME_PATH = '/usr/bin/google-chrome'
@pgolding
pgolding / scan.py
Created Jun 5, 2017
scan all elements from a dynamodb table using Python (boto3)
View scan.py
from __future__ import print_function # Python 2/3 compatibility
import boto3
import json
import decimal
from boto3.dynamodb.conditions import Key, Attr
# Helper class to convert a DynamoDB item to JSON.
class DecimalEncoder(json.JSONEncoder):
def default(self, o):
if isinstance(o, decimal.Decimal):
@HyperBrain
HyperBrain / lifecycle-cheat-sheet.md
Last active Jan 14, 2020
Serverless Lifecycle Cheat Sheet
View lifecycle-cheat-sheet.md

Serverless plugin author's cheat sheet

This cheat sheet provides a detailed overview of the exposed lifecycle events and available commands (and entrypoints) of the Serverless framework, that can be hooked by plugins (internal and external ones). The document is structured by the commands invoked by the user.

Lifecycle events are shown as the globally available outer events (all providers) and sub lifecycle events that are provider specific in the called order. Currently only the AWS provider is shown. If you have information about the other provider,

@mattsornson
mattsornson / geckoboard_madkudu_points_based
Created Apr 4, 2017
Geckboard's Point Based Lead Score
View geckoboard_madkudu_points_based
CASE
WHEN employees >= 500 THEN 50
WHEN employees >= 100 THEN 40
WHEN employees >= 50 THEN 10
WHEN employees >= 25 THEN 5
WHEN employees >= 10 THEN 3
ELSE -2
END
+
CASE
@barrachri
barrachri / proxy_server.py
Created Nov 9, 2016
Proxy Server with aiohttp
View proxy_server.py
import logging
import sys
from urllib.parse import urljoin
import asyncio
import aiohttp
from aiohttp import web
TARGET_SERVER_BASE_URL = 'http://127.0.0.1:8888'
You can’t perform that action at this time.