@levelsio Profile picture
Dec 3, 2018 26 tweets 11 min read Read on X
Starting on the website for ✈ now, I will log the full development right here in this thread 👇 airlinelist.co
Image
I always start like this in my code editor, just raw HTML code, no styling (yet), to get the basic functionality down Image
I'm also adding a BOOK FLIGHT option, which gets the flights from an API like @kiwicom247 and rates each flight by service, comfort, on-time and safety Image
Now I need to get the data from the Google sheet I made into my SQLite database, for that I use this script (I took it from Nomad List's code), it goes over the sheet and inserts all data into the db docs.google.com/spreadsheets/d…Image
I've added database-style column names in the sheet, these have to correspond with the SQLite table structure I'm gonna make now... Image
I use phpLiteAdmin, a light-weight editor for SQLite databases that runs on PHP. Let's make airlines.db! Image
Inside airlines.db I make the table airlines (I always use one table per .db file to keep it simple) Image
Here's my airlines table structure, I can always add/edit later so it doesn't have to be perfect immediately. I use "epoch" as a seconds since 1970-01-01 (epoch) field to save when it's last updated Image
Here's my airlines table structure, I can always add/edit later so it doesn't have to be perfect immediately. I use "epoch" as a seconds since 1970-01-01 (epoch) field to save when it's last updated Image
Here's the code which puts it into SQLite, it's a bit ugly, but makes sure every value I want goes in there. I can make it dynamic later, but for now this is easiest to make. Image
Yay, it worked 😙 the spreadsheet data is now in a SQLite db called airlines.db, now I will try access it from the site... Image
To test if it worked I load the DB on /index.php and do

echo json_encode($airlines);

This prints the data into JSON, so I can see if it's readable by my site.

I can now start putting in a <table> Image
Now I put it in a foreach($airlines as $airline) loop inside <table> HTML, here's how it looks if you open it Image
I made all this on my laptop, so now I want to deploy it to so you can see it too.

I go to @namecheap to DNS and add my server's IP as an A/AA record. It was a URL redirect before to the Google spreadsheet, that ends now. airlinelist.coImage
Now I have to wait for an hour for the name servers to update. Meanwhile I've added some styling to the buttons, and made them toggle-able with jQuery.

I'll go over all the filter buttons to find which one are pressed and then do a call to the server to filter airlines! Image
Image
^ the color of the button I picked from the ✈️ airplane emoji on MacOS. Emojis are a nice way to find colors ^_^
I did some more <style>'ing so now it looks like this. I centered the page by adding a <div class="container"> which wraps around all the elements. It's set to max-width:1000px; and centered with margin:0 auto; Image
Image
Now for some logic. I want the filters to actually do something. So I define each filter inside the button with 3 data tags:

data-key
data-operator
data-value

For ex. safe airline should be

"safety_score"
greater-than
3

(where 3 is out of 5) Image
Here's the JS code for it. It collects each filter's data attributes key, operator and value. Puts them in a data array. This array we will then AJAX to the server where PHP receives it, filters, and sends back the airlines. Image
Image
Yay! It works. JS collects the filters successfully, sends them as AJAX to server and PHP reads the filters accurately. Image
Image
Image
Meanwhile the DNS has propagated. So now we can get a @letsencrypt https SSL certificate. I use an app called CERTBOT for it. If you type CERTBOT CERTONLY it lets you authorize a server. I had to kill my NGINX server for it (I know I'm noob) when doing it for a 30 secs. But works Image
On the server, I edit /etc/nginx/sites/airlinelist.co, which is my virtual host config file for NGINX. It lets the server know I want to have a website with and the server should respond with files from /srv/http/airlinelist.co like index.php! airlinelist.coImage
It's not opening here yet BUT it is on the server. So it can show up any time now. DNS can takes hours, sometimes days to update on all people's providers. Image
Image
While we're waiting for that, I've made the filters work. Every click is an AJAX request with the active filters (see tweets above), and the PHP sends the airlines as <tr><td></td></tr> table rows back! JS then puts that in the <table><tbody>. Very simple.
Okay it seems to be working for some people: try it 👉 airlinelist.co
Added a disclaimer so I don't get sued by airlines + region filters airlinelist.coImage
Image

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with @levelsio

@levelsio Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @levelsio

Aug 24
My new theory is when Jesus turned 12 he went to travel eastwards from Jerusalem to Asia

There he discovered and studied Hinduism/Buddhism for a decade

Then at age 30 he returned to Jerusalem, forked Judaism, added the Hindu/Buddhist concepts to it and that became Christianity
Image
The period from age 12 to 30 in Jesus life is somehow not described anywhere

He just showed up at 30 and did his thing

Most concepts Jesus preached seem to overlap strongly with Buddhism and even more with Hinduism like compassion, love your neighbors and enemies, detachment from materialism, treat others how you'd like to be treated (karma) etcImage
Image
Image
Image
What's interesting is that Islam itself is a 500 year later fork of Christianity and Jesus is a non-holy prophet in the Qu'ran

So if that's true and you keep going back the origins of most religions may just be Hinduism and Judaism

Buddhism itself was a fork of Hinduism too
Read 5 tweets
Jul 27
I think AI hype/bubble won't pop yet until we have full photorealistic video and 3d

Photorealistic images already takes way more GPU than an LLM

And video and 3d is be a multiple of that GPU power

We are very close to dynamically generated real-time immersive 3d worlds Image
Everyone's so deadstared into LLMs

I've always felt people completely underestimate / do not pay enough attention to AI imaging

Maybe because it's only recently leaving uncanny valley

Once it does that might be next to get all the attention again

And these immersive 3d worlds will compete with video games I think
Read 6 tweets
Mar 27
So last year @Wayfair, an $8B company, launched their own AI interior design tool

This week someone at Wayfair asked me to cancel their subscription of , which is my AI interior design tool launched 2 years ago

I was confused why would they sign up to it if they have their own? Well, because they signed up to it before they had their own and used it to build their version of it! 😂

They had 8 different accounts on Interior AI that ran for months 🤯

I learnt a bit about competitive spying today!

Told ya the big companies were checking what indie hackers did, that was my entire point when I said "indie hacking is dead", we're part of the big market now where billion dollar companies are INSIDE our apps!InteriorAI.comImage
Image
Image
If I did competitive spying I'd at least use a different domain name though, not my own company @wayfair.com
P.S. it's all good, I think it's even legal, just kinda funny a big billion dollar company is INSIDE MY APPS!
Read 4 tweets
Sep 2, 2023
Any statistical way to solve this?

I test parameters on Photo AI on a % of photos taken

Then I check what % of photos are ❤️ favorited

Based on that I can figure out what parameters is better on 700,000 photos taken per month

But sometimes you get 1 or 2 users ❤️ favoriting lots of photos with one specific parameter which affects the data and makes one parameter choice come out as a winner when actually it's just a few users doing it

Any stat solution for this?
Right now my SQL is smth like this

SELECT upscale_strength,count(upscale_strength) as cnt FROM photos WHERE upscale_strength IS NOT NULL AND (saved IS NOT NULL) GROUP BY upscale_strength ORDER BY cnt DESC LIMIT 10
I can add count(distinct(user_id)) for ex:

SELECT upscale_strength,count(upscale_strength) as cnt,count(distinct(user_id)) FROM photos WHERE (saved IS NOT NULL) GROUP BY upscale_strength ORDER BY cnt DESC LIMIT 10 Image
Read 6 tweets
Jul 30, 2023
Biggest benefit you have starting out in anything is being a noob and not knowing anything

If you’d share that true honest story it’s super authentic and people love to hear that

But nobody does

Instead I see people on social media faking being succesful with 100 followers
I never understand why people on here aren’t being more radically honest and transparent about their life and work and business situation

Easiest way to get people interested in you because EVERYBODY is still too scared to do it

Way more engagement than being another threadboi… twitter.com/i/web/status/1…
I was already tweeting whatever I did and thought and made 10 years ago when it got 2 likes

Nothing much changed except now ppl listen to it more
Read 7 tweets
May 14, 2023
Only losers go to networking events

The only people you'll meet at events are people who want something from you or aren't meaningfully engaged in a pursuit of their own

The easiest way to meet interesting people is by having accomplished something yourself
All the interesting and unique people I met are after I accomplished something myself and kept doing so or trying to repeatedly

Millionaires and then billionaires will message you if you do interesting stuff

And they become your friends

You won’t meet them at networking events
People that regularly go to networking events are a massive red flag to me

Never met anyone really successful that goes there

The valuable “networking” for lack of a better term happens in DMs, chat groups and meeting up as friends

But they’re not public meetups at all, you’d… twitter.com/i/web/status/1…
Read 5 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(