Skip to content

Instantly share code, notes, and snippets.

@burningTyger
burningTyger / moodle_on_do.md
Last active Sep 7, 2020
How To Install Moodle via git with Postgres, Nginx and PHP on an Ubuntu 16.04 VPS
View moodle_on_do.md

How To Install Moodle via git with Postgres, Nginx and PHP on an Ubuntu 16.04 VPS

Introduction

Moodle is a common online learning platform used in many educational settings around the world. This tutorial aims at giving admins a solid and speedy foundation for serving moodle to a small to medium sized institution. The setup focuses on simple maintenance and fast updates.

Prerequisites

  • Create a small droplet with Ubuntu 16.04 (64Bit is great)
  • Follow the tutorial on setting up Ubuntu 16.04
  • git should be installed by default
@burningTyger
burningTyger / arch.sh
Last active Aug 9, 2020
Install Arch
View arch.sh
# This guide is based on https://wiki.archlinux.org/index.php/User:Altercation/Bullet_Proof_Arch_Install
# compare for more details on each step. It's a great guide and seems to get frequent updates.
# This guide has a few changes that helped me to get thew bootloader running
# Start up the Live USB/CD and enable SSH:
# set a password for root to enable ssh login
# *
passwd
systemctl start sshd.service
@burningTyger
burningTyger / comile.sh
Created Aug 4, 2019
sqlite with icu support
View comile.sh
# in order to have icu support in sqlite you need to enable it via compile options.
# install the icu dev package on your system and download the source files from sqlite
# unpack and enter the source dir
# on a mac I had to do this to compile:
brew install icu4c
CFLAGS=`-I/usr/local/opt/icu4c/include -O3 -DSQLITE_ENABLE_ICU` CPPFLAGS=`icu-config --cppflags` LDFLAGS=`-L/usr/local/opt/icu4c/lib icu-config --ldflags` ./configure
# I had to add the path to the icu libs
View App.svelte
<h1>{selected.link || 'No selection'}</h1>
<div class="search">
<input bind:value={term} on:keydown={keydown} class="input" on:blur={() => options = []}>
<ul class="list">
{#each options as t,i}
<li
class={`item ${i+1 === pos ? 'active':''}`}
value={t.link}
on:click={() => select(t)}
>{t.value}</li>
@burningTyger
burningTyger / 29-prettify.conf
Created Dec 6, 2014
Arch better looking fonts for Chrome
View 29-prettify.conf
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<match target='font' >
<edit mode='assign' name='rgba' >
<const>rgb</const>
</edit>
</match>
<match target='font' >
<edit mode='assign' name='hinting' >
@burningTyger
burningTyger / README.md
Created Feb 20, 2018 — forked from chrislkeller/README.md
Displaying data from a flat JSON file on a Handlebars.js template file rendered with AJAX.
View README.md

Demo: ajax-handlebars

This repo's location has changed.

View basemodel.js
class BaseModel extends Model {
static get allRelations() {
return '[' + Object.keys(this.relationMappings).join(',') + ']';
}
}
//And then inherit your models from that instead of Model.
class Person extends BaseModel {
//...
@burningTyger
burningTyger / sencond_deploy.md
Last active Aug 30, 2017
How to deploy your openshift app to a second instance
View sencond_deploy.md

##How to deploy your openshift app to a second instance

I set up Moodle for myself on Openshift which I explained here: https://github.com/burningTyger/openshift_moodle

Now I wanted to install Moodle for a friend who has his own user and his own domain on openshift. Since I'm the admin why bother creating a second app which is basically the exact same app as mine and will most cetainly need the exact same updates. DRY!

So I decided to find out how I can use the app repo on two different instances of openshift. This is how it works (there might be better solutions, let me know):

You log in as the second user and create a new app. This will give you a git URL. Copy this URL and head over to you app repo (Moodle used in this example):

@burningTyger
burningTyger / authentication.rb
Created Dec 7, 2011 — forked from jnunemaker/authentication.rb
a starting point for authentication with mongomapper and rails
View authentication.rb
# include this in application controller
module Authentication
protected
# Inclusion hook to make #current_user and #signed_in?
# available as ActionView helper methods.
def self.included(base)
base.send :helper_method, :current_user, :signed_in?, :authorized? if base.respond_to? :helper_method
end
# Returns true or false if the user is signed in.
View README.md
You can’t perform that action at this time.