Skip to content

Instantly share code, notes, and snippets.

@burningTyger
burningTyger / moodle_on_do.md
Last active September 20, 2023 03:07
How To Install Moodle via git with Postgres, Nginx and PHP on an Ubuntu 16.04 VPS

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 / gist:1301958
Created October 20, 2011 18:52
how to remove short vowels from Arabic strings

How to remove short vowels from Arabic strings

sometimes you might want to search Arabic text. Don't just let the user decide on the search string. You never know how your target string is spelled (short vowels are optional).

One way of doing it is to keep a devowelized string of the target and whenever a user wants to search it, strip all short vowels again.

To do so use this method:

@burningTyger
burningTyger / comile.sh
Created August 4, 2019 18:54
sqlite with icu support
# 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
@burningTyger
burningTyger / notes.txt
Created August 13, 2016 11:32
Getting system clipboard access in vim in tmux in ssh
If you'd like to use `"*y` and `"*p` in neovim you have to make sure it works across the stack.
These steps are necessary:
* Have xsel installed
* enable `X11Forward` in your remote sshd.conf
* disable `X11Localhost` in the same file
Then restart your ssh connction with the -Y flag and make sure to restart tmux otherwise you might get errors because $DISPLAY might not yet be set.
@burningTyger
burningTyger / arch.sh
Last active February 3, 2023 01:52
Install Arch
# 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 / 29-prettify.conf
Created December 6, 2014 13:24
Arch better looking fonts for Chrome
<?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 / mdb2sql
Created October 21, 2015 21:35
use mdbtools to convert mdb to sql
#!/bin/bash
# found this here: http://stackoverflow.com/questions/5722544/how-can-i-convert-an-mdb-access-file-to-mysql-or-plain-sql-file
#
# Create DB like this: CREATE DATABASE xyc;
# To invoke it simply call it like this:
# ./mdbconvert.sh accessfile.mdb mysqldatabasename
TABLES=$(mdb-tables -1 $1)
MUSER="root"
@burningTyger
burningTyger / authentication.rb
Created December 7, 2011 17:01 — forked from jnunemaker/authentication.rb
a starting point for authentication with mongomapper and rails
# 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.
@burningTyger
burningTyger / App.svelte
Last active February 20, 2019 23:13
autocomplete
<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 / README.md
Created February 20, 2018 18:47 — forked from chrislkeller/README.md
Displaying data from a flat JSON file on a Handlebars.js template file rendered with AJAX.

Demo: ajax-handlebars

This repo's location has changed.