Skip to content

Instantly share code, notes, and snippets.

View delenamalan's full-sized avatar

Delena Malan delenamalan

View GitHub Profile
@delenamalan
delenamalan / pomodoro
Created January 31, 2020 16:26
Bash Pomodoro-style timer for Ubuntu
#!/bin/sh
# Pomodoro-style timer for Ubuntu
# Usage `pomodoro [WORK DURATION] [SHORT BREAK DURATION] [LONG BREAK DURATION]
while true
do
for i in {1..4}
do
sleep ${1:-25m}
notify-send "Time to take a short break"
@delenamalan
delenamalan / index.html
Created September 7, 2019 13:20
Test Pre-Populate SMS
<!DOCTYPE html>
<html>
<head>
<title>Our Funky HTML Page</title>
<meta name="description" content="Our first page" />
<meta name="keywords" content="html tutorial template" />
</head>
<body>
Content goes here.
<a href="sms:+27721232233?body=Hello">Android</a>
@delenamalan
delenamalan / .block
Last active August 12, 2019 07:35
Mouseout demo
license: gpl-3.0
@delenamalan
delenamalan / faulty_data.csv
Last active May 7, 2019 11:37
Budget data tests
BudgetPhase Department EconomicClassification1 EconomicClassification2 EconomicClassification3 FinancialYear Government Programme ProgNumber Value EconomicClassification4 EconomicClassification5 FunctionGroup1 FunctionGroup2 Subprogramme SubprogNumber VoteNumber
Audited Outcome Cooperative Governance And Traditional Affairs Current Payments Compensation Of Employees Salaries And Wages 2019 Eastern Cape Administration 1 121283000
Adjusted appropriation Cooperative Governance And Traditional Affairs Current Payments Compensation Of Employees Salaries And Wages 2018 Eastern Cape Administration 1 141351530.3
Main appropriation Cooperative Governance And Traditional Affairs Current Payments Compensation Of Employees Salaries And Wages 2018 Eastern Cape Administration 1 149449499
@delenamalan
delenamalan / boston_mechanism.py
Created April 8, 2019 09:53
School Choice Algorithms
"""
Implementation of the Boston Mechanism algorithm from:
https://www.bc.edu/content/dam/files/schools/cas_sites/economics/pdf/workingpapers/wp729.pdf
"""
I = (1, 2, 3, 4, 5)# Set of students
C = ('a', 'b', 'c', 'd', 'e') # Set of schools
q = [1 for x in xrange(5)] # Quota for each school
# Strict preference relation of each student
# List of school choices for each student in order of preference.
@delenamalan
delenamalan / index.html
Created January 25, 2019 16:43
Vue.js 2.0 Todo List ✅ with Local Storage 📦
<div class="app" id="app">
<form class="form" v-on:submit="addTodo">
<input class="input form__input" v-model="inputVal"/>
<button class="btn form__submit-btn" type="submit">Add</button>
</form>
<transition-group tag="ol" name="list" class="todo-list">
<li
class="todo-list__item"
v-bind:class="{ complete: todo.complete }"
v-bind:key="index"
@delenamalan
delenamalan / mm-394-script.js
Last active August 31, 2017 08:57
mm-394-script.js
var collection = db.addressbook_2;
collection.find({'fields.verificationChannel': 'iOS'}).forEach(function(doc) {
if (doc.fields && (!doc.fields.latitude || !doc.fields.longitude)) {
collection.update(
{_id : doc._id},
{$set: { "fields.requiresVerification": "true"}}
);
} else if (doc.fields && ((doc.fields.latitude && doc.fields.latitude % 1 == 0) || (doc.fields.longitude && doc.fields.longitude == 0))) {
collection.update(
{_id : doc._id},
@delenamalan
delenamalan / .vimrc
Created August 21, 2017 09:02
.vimrc
" When started as "evim", evim.vim will already have done these settings.
if v:progname =~? "evim"
finish
endif
" Use Vim settings, rather than Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
" set the runtime path to include Vundle and initialize
@delenamalan
delenamalan / update_all_repos.sh
Created August 21, 2017 09:00
Update and rebase all repositories in a folder
#!/bin/bash
for f in */
do
echo "Processing $f ..."
cd $f || continue
if [ -d .git ]; then
git branch
git remote update
git rebase origin/master
fi;