Skip to content

Instantly share code, notes, and snippets.

View talhasch's full-sized avatar

Talha talhasch

View GitHub Profile
@talhasch
talhasch / clean_emoji
Last active August 29, 2015 14:21
python function that removes emojis from text
def clean_emoji(text):
import re
try:
# Wide UCS-4 build
emoji_re = re.compile(u'['
u'\U0001F300-\U0001F64F'
u'\U0001F680-\U0001F6FF'
u'\u2600-\u26FF\u2700-\u27BF]+',
re.UNICODE)
@talhasch
talhasch / python-webpage-screenshot
Last active November 4, 2018 19:45
python webpage screenshot
#!/usr/bin/python
# -*- coding: utf-8 -*-
import uuid
import time
import optparse
import json
import urllib2
import os
import logging
@talhasch
talhasch / kivy-list-detail-example.py
Last active January 26, 2016 19:48
kivy list detail example
import kivy
from kivy.app import App
from kivy.uix.screenmanager import Screen, ScreenManager
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label
from kivy.uix.button import Button
from kivy.uix.scrollview import ScrollView
from kivy.properties import ObjectProperty, StringProperty
Verifying my Blockstack ID is secured with the address 1KmEtoKS5tukFrSVMo8nPyD3U3T3tJaLxR https://explorer.blockstack.org/address/1KmEtoKS5tukFrSVMo8nPyD3U3T3tJaLxR
@talhasch
talhasch / 404.html
Last active December 27, 2021 18:29
404.html template
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>404 - Page Not Found</title>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
background: #f9f9f9;
@talhasch
talhasch / pgsql_backup.sh
Created May 19, 2020 07:49 — forked from sirbrillig/pgsql_backup.sh
Postgresql daily backup script.
#!/bin/bash
#
# Backup a Postgresql database into a daily file.
#
BACKUP_DIR=/pg_backup
DAYS_TO_KEEP=14
FILE_SUFFIX=_pg_backup.sql
DATABASE=
USER=postgres
@talhasch
talhasch / hivemind-update.sh
Last active December 14, 2020 08:48
hivemind update script
#!/bin/bash
cd /root/hivemind/
git pull
python3 setup.py build
python3 setup.py install --user