Skip to content

Instantly share code, notes, and snippets.

View dizzersee's full-sized avatar
𝓉𝒽𝑒𝓇𝑒'𝓈 𝒸𝑜𝒻𝒻𝑒𝑒 𝒾𝓃 𝓉𝒽𝒶𝓉 𝓃𝑒𝒷𝓊𝓁𝒶

Alexandra Axt dizzersee

𝓉𝒽𝑒𝓇𝑒'𝓈 𝒸𝑜𝒻𝒻𝑒𝑒 𝒾𝓃 𝓉𝒽𝒶𝓉 𝓃𝑒𝒷𝓊𝓁𝒶
  • Germany
View GitHub Profile
@Benjiko99
Benjiko99 / DbMigrationsHelper.kt
Last active February 2, 2022 18:16
Android Room Database migration helper for ALTER TABLE
object Example {
fun alterTableUsage(database: SupportSQLiteDatabase) {
DbMigrationsHelper.alterTable(
db = database,
tableName = "Reservations",
columns = mapOf(
"id INTEGER".toExisting(), // Retains without changes
"title TEXT".toExisting("name"), // Renames column "name" to "title"
"description TEXT".toNothing(), // Adds a new column
@shov
shov / Dockerfile
Created May 21, 2018 09:36
Docker PHP 7.2 fpm with GD jpg, png suppot
FROM php:7.2-fpm
# Replace shell with bash so we can source files
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
# make sure apt is up to date
RUN apt-get update --fix-missing
RUN apt-get install -y curl
RUN apt-get install -y build-essential libssl-dev zlib1g-dev libpng-dev libjpeg-dev libfreetype6-dev
@Geoyi
Geoyi / install virtualenv ubuntu 16.04.md
Created September 16, 2017 12:19 — forked from frfahim/install virtualenv ubuntu 16.04.md
How to install virtual environment on ubuntu 16.04

How to install virtualenv:

Install pip first

sudo apt-get install python3-pip

Then install virtualenv using pip3

sudo pip3 install virtualenv 
@chrisliuqq
chrisliuqq / php.php
Last active June 4, 2019 08:14
How to use laravel Auth::user() outside laravel and pass data in custom php?
The solution above for 5.2 should still work. In 5.5+ you just need to change bootstrap/autoload.php to vendor/autoload.php.
<?php
require '/path/to/laravel/vendor/autoload.php';
$app = require_once '/path/to/laravel/bootstrap/app.php';
$app->make('Illuminate\Contracts\Http\Kernel')
->handle(Illuminate\Http\Request::capture());
@fractefactos
fractefactos / pivot_example.php
Last active October 17, 2022 08:47 — forked from lighta971/pivot_example.php
Laravel Custom Pivot Model definition example
<?php
//https://github.com/laravel/framework/issues/2093#issuecomment-39154456
use Illuminate\Database\Eloquent\Model as Eloquent;
use Illuminate\Database\Eloquent\Relations\Pivot;
class User extends Eloquent {
public function groups() {
return $this->belongsToMany('Group');
@maxwells
maxwells / linearColorInterpolator.js
Created January 4, 2014 03:34
Find the color between any two color points through linear interpolation. Pretty basic & straight forward. Progress bar demo at: http://jsfiddle.net/99ycK/1/
Color = function(hexOrObject) {
var obj;
if (hexOrObject instanceof Object) {
obj = hexOrObject;
} else {
obj = LinearColorInterpolator.convertHexToRgb(hexOrObject);
}
this.r = obj.r;
this.g = obj.g;
this.b = obj.b;

[abc] A single character: a, b or c
[^abc] Any single character but a, b, or c
[a-z] Any single character in the range a-z
[a-zA-Z] Any single character in the range a-z or A-Z
^ Start of line
$ End of line
\A Start of string
\z End of string
. Any single character
\s Any whitespace character