Skip to content

Instantly share code, notes, and snippets.

@talhasch
talhasch / hivemind-update.sh
Last active Dec 14, 2020
hivemind update script
View hivemind-update.sh
#!/bin/bash
cd /root/hivemind/
git pull
python3 setup.py build
python3 setup.py install --user
@talhasch
talhasch / pgsql_backup.sh
Created May 19, 2020 — forked from sirbrillig/pgsql_backup.sh
Postgresql daily backup script.
View pgsql_backup.sh
#!/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 / 404.html
Last active Dec 17, 2020
404.html template
View 404.html
<!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;
View gist:f539c4aa56065a652d41cd152317f523
Verifying my Blockstack ID is secured with the address 1KmEtoKS5tukFrSVMo8nPyD3U3T3tJaLxR https://explorer.blockstack.org/address/1KmEtoKS5tukFrSVMo8nPyD3U3T3tJaLxR
@talhasch
talhasch / kivy-list-detail-example.py
Last active Jan 26, 2016
kivy list detail example
View kivy-list-detail-example.py
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
@talhasch
talhasch / python-webpage-screenshot
Last active Nov 4, 2018
python webpage screenshot
View 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 / clean_emoji
Last active Aug 29, 2015
python function that removes emojis from text
View clean_emoji
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)