Skip to content

Instantly share code, notes, and snippets.

View jossef's full-sized avatar
🌶️

Jossef Harush Kadouri jossef

🌶️
View GitHub Profile
@jossef
jossef / publish-drafts.js
Created January 28, 2023 21:40
a fork of niedzwiedzw/youtube-publish-drafts
(() => {
const MODE = 'publish_drafts';
const DEBUG_MODE = true;
const MADE_FOR_KIDS = false;
const VISIBILITY = 'Unlisted';
const SORTING_KEY = (one, other) => {
return one.name.localeCompare(other.name, undefined, {numeric: true, sensitivity: 'base'});
};
const TIMEOUT_STEP_MS = 20;
const DEFAULT_ELEMENT_TIMEOUT_MS = 10000;
@apisandipas
apisandipas / share-urls.md
Last active May 9, 2024 15:31 — forked from chrisjlee/drupal-views-share-global-text-field
Share url's for Facebook, Twitter, Pinterest and Linkedin with just get variables

Creating share buttons with just URL's

Twitter

http://twitter.com/share?text=<TITLE>&url=<URL>

E.g. http://twitter.com/share?text=This+is+google+a+search+engine&url=https%3A%2F%2Fwww.google.com

Facebook

http://www.facebook.com/sharer.php?u=&amp;p[title]=

@arulrajnet
arulrajnet / colors.py
Last active January 2, 2023 04:45 — forked from jossef/colors.py
python coloring for linux, based on this answer http://stackoverflow.com/a/26445590/3191896 and modified to make it more usable in a pythonic way.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
class Color(object):
"""
reference from https://gist.github.com/Jossef/0ee20314577925b4027f and modified bit.
"""
def __init__(self, text, **user_styles):
@jossef
jossef / colors.py
Last active February 2, 2023 20:39
python coloring for linux, based on this answer http://stackoverflow.com/a/26445590/3191896
def color(text, **user_styles):
styles = {
# styles
'reset': '\033[0m',
'bold': '\033[01m',
'disabled': '\033[02m',
'underline': '\033[04m',
'reverse': '\033[07m',
@jossef
jossef / mailsender.py
Last active June 22, 2021 22:56
python gmail smtp mail sender with images
from email.mime.image import MIMEImage
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
class MailSender(object):
def __init__(self, username, password, server='smtp.gmail.com', port=587, use_tls=True):
self.username = username
@EpokK
EpokK / ngEnter.js
Last active January 7, 2022 13:57
ngEnter directive if you can use submit form(https://twitter.com/ririlepanda)
app.directive('ngEnter', function() {
return function(scope, element, attrs) {
element.bind("keydown keypress", function(event) {
if(event.which === 13) {
scope.$apply(function(){
scope.$eval(attrs.ngEnter);
});
event.preventDefault();
}
@ikautak
ikautak / cmd_complete_decorator.py
Last active May 19, 2016 08:18
auto complete decorator for cmd module.
#!/usr/bin/env python
import os
import cmd
def file_auto_complete(text, line, begidx, endidx):
""" auto complete of file name.
"""
line = line.split()
@durran
durran / mongodb.monitrc
Created December 1, 2011 14:14
MongoDB Monit Config
check process mongodb
with pidfile "/var/lib/mongodb/mongod.lock"
start program = "/sbin/start mongodb"
stop program = "/sbin/stop mongodb"
if failed port 28017 protocol http
and request "/" with timeout 10 seconds then restart
if 5 restarts within 5 cycles then timeout