Skip to content

Instantly share code, notes, and snippets.

@ameen-sarsour
ameen-sarsour / PHP apple sign in
Last active September 3, 2024 09:44
this code to try php sign in,
<?php
/**
* This file to test apple sign in,
* Need to app information from Apple
*
* Team Id
* Client Id
* Key Id
* and Private key
@verticalgrain
verticalgrain / wordpress-json-cheatsheet.md
Last active November 23, 2023 10:00
Wordpress JSON API Cheat Sheet

POSTS:

Get a post by id:

http://mixmeals.com/wp-json/wp/v2/posts/?filter[p]=12

Get multiple posts by id:

http://mixmeals.com/wp-json/wp/v2/posts/?include=470,469

@soheilhy
soheilhy / nginxproxy.md
Last active April 11, 2025 06:29
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

IMPORTANT
Please duplicate this radar for a Safari fix!
This will clean up a 50-line workaround.
rdar://22376037 (https://openradar.appspot.com/radar?id=4965070979203072)
//////////////////////////////////////////////////////////////////////////////
(Now available as a standalone repo.)
@Tehnix
Tehnix / CloudFlare API.md
Created August 5, 2013 23:34
A simple look at the cloudflare API with python.

Since we, and a lot of other people, are using CloudFlare for optimization reasons (aka, the easy way out), I thought I would take a look at their API. First thing I looked for was how to purge the cache from command line.

Now, if you don't know why I'd want to do this, let me explain. We have setup codetalk.io as a Django project, with nginx running fastcgi passing it through on localhost which Django is listening to and then responds accordingly.

Now, we usually make some changes here and there, styles and structuring. One of the things CloudFlare does for us, is cache some of our content, mainly CSS and JS. Caching, in this case, means that instead of the request coming all the way down to our server to get the file, it is picked up by CloudFlare that has set a cache time for it sparing us the load of serving it again and again (if you know varnish, they kindda act like a varnish proxy in front of us).

So, CloudFlare needs to know when we have updated our content so it can purge the cache and begin asse