Skip to content

Instantly share code, notes, and snippets.

@ebraminio
ebraminio / challenge_2.sql
Last active April 7, 2023 22:03 — forked from kartikynwa/challenge_2.sql
Challenge 2 of https://yrashk.com/blog/2023/04/04/make-postgres-an-application-server-gamified/ based on kartikynwa version but without plpgsql
create table if not exists users
(
id int primary key generated always as identity,
name text not null
);
create table if not exists apikeys
(
userid int references users(id),
apikey text not null
@ebraminio
ebraminio / mingw-w64-x86_64.cmake
Last active April 15, 2024 15:04 — forked from peterspackman/mingw-w64-x86_64.cmake
cmake toolchain file for mingw-w64 x86_64 builds on Ubuntu
# Sample toolchain file for building for Windows from an Ubuntu Linux system.
#
# Typical usage:
# *) install cross compiler: `sudo apt-get install mingw-w64` or `brew install mingw-w64` on macOS
# *) cmake -DCMAKE_TOOLCHAIN_FILE=~/mingw-w64-x86_64.cmake -G Ninja -B build -S .
# *) ninja -C build
set(CMAKE_SYSTEM_NAME Windows)
set(TOOLCHAIN_PREFIX x86_64-w64-mingw32)
@ebraminio
ebraminio / Dagger2SimpleExample.java
Last active September 26, 2018 17:44 — forked from vestrel00/Dagger2SimpleExample.java
A: Dagger.android 2.11 simple example with support for Singleton, PerActivity, PerFragment, and PerChildFragment scopes
// This is a super simplified example of how to use the new dagger.android framework
// Forked from https://gist.github.com/vestrel00/64be913f954989fe52c674247e093218/
// but changed to have less boilerplate using the new features.
// Used on https://github.com/ebraminio/DroidPersianCalendar also
// App.java
public class App extends DaggerApplication {
@Override
protected AndroidInjector<? extends DaggerApplication> applicationInjector() {
return DaggerAppComponent.builder().create(this);
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.