Skip to content

Instantly share code, notes, and snippets.

Delena Malan delenamalan

Block or report user

Report or block delenamalan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View faulty_data.csv
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 Apr 8, 2019
School Choice Algorithms
View boston_mechanism.py
"""
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 Jan 25, 2019
Vue.js 2.0 Todo List with Local Storage 📦
View index.html
<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"
View 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},
View .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 Aug 21, 2017
Update and rebase all repositories in a folder
View update_all_repos.sh
#!/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;
@delenamalan
delenamalan / repeat_command.sh
Created Jul 8, 2017
Repeat a bash command from https://stackoverflow.com/a/41191408/3486675 e.g. repeat_command.sh "kubectl get pods --all-namespaces"
View repeat_command.sh
#!/bin/bash
while true; do
# COMMAND=$(kubectl get pods --all-namespaces) #Save command result in a var.
COMMAND=$($1) #Save command result in a var.
echo "$COMMAND" #Print command result, including new lines.
sleep 3 #Keep above's output on screen during 3 seconds before clearing it
#Following code clears previously printed lines
LINES=$(echo "$COMMAND" | wc -l) #Calculate number of lines for the output previously printed
@delenamalan
delenamalan / data.csv
Created Jul 31, 2016 — forked from d3noob/data.csv
Simple d3.js tooltips
View data.csv
date close
1-May-12 58.13
30-Apr-12 53.98
27-Apr-12 67.00
26-Apr-12 89.70
25-Apr-12 99.00
24-Apr-12 130.28
23-Apr-12 166.70
20-Apr-12 234.98
19-Apr-12 345.44
@delenamalan
delenamalan / .vimrc
Last active Aug 14, 2016
My .vimrc. There's still a lot I want to add and fix.
View .vimrc
colorscheme peachpuff
set textwidth=80
set tabstop=2
set expandtab " use spaces for tabs
set softtabstop=2
set shiftwidth=2
set autoindent
syntax on
You can’t perform that action at this time.