Skip to content

Instantly share code, notes, and snippets.

@yelluw
yelluw / postgres-backup.sh
Created November 9, 2020 05:19 — forked from 4410287/postgres-backup.sh
Shell script for daily postgres database backup with basic archiving.
#!/bin/bash
# Written 2018-11-15 by 4410287
# This script will create a backup file of a postgres database and compress it. It is capable of access a local or remote server to pull the backup. After creating a new backup, it will delete backups that are older than 15 days, with the exception of backups created the first of every month. It is recommended to create a seperate database user specifically for backup purposes, and to set the permissions of this script to prevent access to the login details. Backup scripts for different databases should be run in seperate folders or they will overwrite each other.
HOSTNAME=
USERNAME=
PASSWORD=
DATABASE=
class Employee(object):
def __init__(self, lastname, clock_number, hire_date):
self.last_name = lastname
self.clock_number = clock_number
self.hire_date = hire_date
# Fork this gist and continue adding code :)
@yelluw
yelluw / nikeza-sql-schema.md
Last active July 24, 2017 18:56
Nikeza SQL Schema

Related to Nikeza issue #77

Schema

Tables

Authentication

  • Users
@yelluw
yelluw / Sample.fsproj
Created July 5, 2017 03:22 — forked from awright18/Sample.fsproj
F# http reqeust with HttpClient
<Project Sdk="FSharp.NET.Sdk;Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp1.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="Program.fs" />
</ItemGroup>
@yelluw
yelluw / osstoken.md
Created July 4, 2017 05:25 — forked from yrashk/osstoken.md
OSS Token

Open Source Software Token[s]

The idea behind this is to research and experiment with "smart contract" funding for open source and free software.

  • Allow less-known developers / projects to earn the public's trust ("cautious funding" — helping them build a reputation of being able to deliver)
  • Allow direct organization/person funding (simple token transfer)
  • Allow funding specific goals (bounties)
  • Allow branding [sub]tokens for a specific project (bragging, voting, other kinds of rights)
  • Allow continuous support pledges (recurring payments)
  • Allow nominees to exchange tokens for the amount they were originally bought for (backed by ETH, the funding is deposited through an ICO, or a series of offerings)
@yelluw
yelluw / flag_code.py
Last active May 15, 2017 21:41
Helping beginner with scope issues.
from turtle import *
import Tkinter
class flag(object):
'''
classdocs
'''
def __init__(self, params):
@yelluw
yelluw / classes_intro.py
Last active May 13, 2017 22:15
Intro to Python classes for you.
"""
Dude,
A Python class is something that defines a thing.
Huh?
Let me explain.
Say we are told to create an app about beds. Yes, beds.
Computers don't know what beds are (otherwise they'd be sleeping all day).
It is our job to tell them what a bed is and how it works.
@yelluw
yelluw / maybe-patterns.py
Created April 20, 2017 18:23
Maybe, pattern matching, Python, and Lisp
def maybe(fn_true, fn_false):
"""
Call me maybe
fn_true = function that will run if evaluates to true
fn_false = function that will run if evaluate to false
Both functions must return tuple(Boolean, any type value)
@yelluw
yelluw / roman-numeral-calculator.py
Last active April 18, 2017 02:32
Roman numeral calculator
"""
Roman Numeral calculator
"""
def value(numeral):
"""
numeral = string
Returns base 10 value of roman numeral
if found else returns None
class testDelay(object):
"""
Measures, tracks, and saves script delay into txt file
"""
def __init__(self, accUser=None, accKey=None, myMask=None):
self.__accUser=accUser
self.__accKey=accKey
self.__myMask=myMask