Skip to content

Instantly share code, notes, and snippets.

View Southclaws's full-sized avatar
🌸
live laugh love'n my way to aesthetic nirvana

Barnaby Keene Southclaws

🌸
live laugh love'n my way to aesthetic nirvana
View GitHub Profile

Server Information

Canonical Invite Link: https://discord.gg/samp Spread the word!

- Rules -

Staff have the right to kick/ban if they believe such action is justified. In general, warnings will be issued and discussed with users first.

  • Respect - Just don't be a dick. Banter is fine but don't be hateful or harrass users.
  • Topics - Conversations diverge and that's fine but if someone says move channel, move. Memes in #memes only.
{
"ld": {
"@context": "http://schema.org",
"@type": "Person",
"email": "mailto:Southclaws@gmail.com",
"image": "https://southcla.ws/static/Southclaw-icon-vec-final-square-0500.png",
"name": "Barnaby Keene",
"birthDate": "1994-12-04",
"gender": "male",
"nationality": "British",
@Southclaws
Southclaws / react-router-auth-workflow-typescript.tsx
Created November 5, 2017 20:16
I wrestled with this for a while so I figured I'd share it.
class App extends React.Component<{}, AppState> {
// IfLoggedIn is a TypeScript version of:
// https://reacttraining.com/react-router/web/example/auth-workflow
// it's just a stateless component that takes path and component (similar to <Route>)
// and renders the component if the user is logged in, if not, it redirects to /login
IfLoggedIn = (thisProps: { path: string; component: Function }) => {
return (
<Route
render={props =>
@Southclaws
Southclaws / react-router-auth-workflow-typescript.tsx
Last active November 5, 2017 20:20
I wrestled with this for a while so I figured I'd share it. It's a TypeScript implementation of the example "auth workflow" from the React Router docs, it's effectively the same concept just spiced up with types and it's embedded into a class so it can access app state easily.
class App extends React.Component<{}, AppState> {
// IfLoggedIn is a TypeScript version of:
// https://reacttraining.com/react-router/web/example/auth-workflow
// it's just a stateless component that takes path and component (similar to <Route>)
// and renders the component if the user is logged in, if not, it redirects to /login
IfLoggedIn = (thisProps: { path: string; component: Function }) => {
return (
<Route
render={props =>
### Keybase proof
I hereby claim:
* I am Southclaws on github.
* I am southclaws (https://keybase.io/southclaws) on keybase.
* I have a public key whose fingerprint is E0C0 AE2C 4072 A0C8 45BE 1F44 EA80 DFDE FBFC 03D2
To claim this, I am signing this object:
@Southclaws
Southclaws / pawn-entities.pwn
Last active December 31, 2017 17:03
Southclaw's "Object Oriented" modular style for Pawn. This documents the basics of structuring a create/destroy type entity. This method can be used for almost any kind of "thing" that can be created, destroyed and modified within its life cycle. Sure it's not *real* object oriented programming but it uses the same methodologies and lifecycle co…
/*
Southclaw's "Object Oriented" modular coding style for Pawn. This documents
the basics of structuring a create/destroy type entity. This method can be
used for almost any kind of "thing" that can be created, destroyed and
modified within its life cycle.
*/
#include <YSI\y_hooks>
/*
#define FILTERSCRIPT
#include <a_samp>
#include <sscanf2>
#include <md-sort>
stock Float:Distance2D(Float:x1, Float:y1, Float:x2, Float:y2)
return floatsqroot( ((x1-x2)*(x1-x2)) + ((y1-y2)*(y1-y2)) );
#define MAX_DATA (2117)
#define MAX_BLOCK (199)
@Southclaws
Southclaws / texturemap
Created May 31, 2014 22:59
Bitmap object placement filterscript
#include <a_samp>
#include <MapAndreas> // -
#include <easybmp> // -
#include <YSI\y_iterate> // -
#include <virtualcanvas> // - https://gist.github.com/Southclaw/9dc3e084370e6998ec08
#include <streamer> // -
#include <formatex> // -
#pragma dynamic 64000
#define FILENAME "./scriptfiles/txmap/basic_small.bmp"
@Southclaws
Southclaws / virtualcanvas.inc
Created May 31, 2014 22:59
Virtual canvas for translating resolutions to world coordinates.
/*
Virtual Canvas
For scaling squares and stuff like that.
It literally has 3 functions work it out.
*/
#if !defined MAX_VIRTUAL_CANVAS
#define MAX_VIRTUAL_CANVAS (VirtualCanvas:32)
#endif