Skip to content

Instantly share code, notes, and snippets.

View lucca65's full-sized avatar

Julien Lucca lucca65

View GitHub Profile
@lucca65
lucca65 / supabase.prisma
Created November 11, 2023 14:29
Prisma file with models from Supabase
model audit_log_entries {
instance_id String? @db.Uuid
id String @id @db.Uuid
payload Json? @db.Json
created_at DateTime? @db.Timestamptz(6)
ip_address String @default("") @db.VarChar(64)
@@index([instance_id], map: "audit_logs_instance_id_idx")
@@schema("auth")
}
defmodule Hub do
@moduledoc """
Publish/subscribe server.
Subscription is done with a pattern.
Example:
{:ok, _pid} = Hub.start_link(name: :hub)
Hub.subscribe(:hub, %{count: count} when count > 42)
@lucca65
lucca65 / docker-compose.yml
Created September 6, 2018 02:40
Esse funciona!
version: "3"
services:
builder:
build:
context: builder
image: eosio/builder:v1.2.2
nodeosd:
container_name: nodeosd
.gradient-blue {
background: #283c86;
background: -webkit-gradient(linear, left top, right top, from(#45a247), to(#283c86)) !important;
background: linear-gradient(to right, #45a247, #283c86) !important
}
.gradient-love {
background: #cc2b5e;
background: -webkit-gradient(linear, left top, right top, from(#cc2b5e), to(#753a88)) !important;
@lucca65
lucca65 / Rakefile
Last active October 5, 2017 00:42
Simple Rakefile to be used with Jekyll to easily generate new drafts for your blog. used on http://atomicbit.io/ruby/jekyll/2015/04/24/rakefile-for-new-posts-in-jekyll.html
require 'date'
desc 'Create a new draft post'
task :post do
STDOUT.puts('Whats the title of your post?')
title = STDIN.gets.chomp
if title.nil? || title.empty?
STDOUT.puts('No post name? Aborting...')
next
@lucca65
lucca65 / newWeb3.js
Last active September 30, 2017 00:06
web3_example.js
const web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"))
const abi = JSON.parse('. . .')
const address = '0x593b851932dAFdf8573Ed7891518b1Ba5B0d5838'
const contract = web3.eth.contract(abi).at(address)
contract.setMessage("I'm picke Rick motherfucker!", {
value: web3.toWei('10', 'finney'),
from: '0x004fC1D0F9C8d126418ab466b03A4B0E55422B64'
}, (error, result) => {
if (error) {

How to make money, in a simple way.

A) Goal

Your goal is to make $10k per month for 6 months so you can pay for higher education. Which can be broken down to a simpler make $350 per day, every day. So in 30 days you will make $10k. Which can be further broken down to selling something that will net you a profit of $350 per day.

Let's call this thing the product. 

#include <iostream>
#include <cmath>
#include <climits>
using namespace std;
const int MAX_N = 510;
const int MAX_K = 510;
int N, K;
@lucca65
lucca65 / network_fail_handler.ex
Created March 10, 2017 02:20
Gen server that handle nerves nodes changing its IP and updates its node name
defmodule MyApp.DistributionManager do
use GenServer
require Logger
@app Mix.Project.config[:app]
def start_link(iface) do
GenServer.start_link(__MODULE__, iface)
end