Skip to content

Instantly share code, notes, and snippets.

View Southclaws's full-sized avatar
⛰️
have you heard the good word of storyden?

Barnaby Keene Southclaws

⛰️
have you heard the good word of storyden?
View GitHub Profile

A quick proposal example for a preprocessor.

Input file "some-sql.pwn":

stock doSomeSQL() {
    @SQL(mysql_pqueryf, 10, 20) {
        SELECT *
        FROM table
 WHERE x=y
@Southclaws
Southclaws / github-release-downloads.sh
Created July 3, 2018 13:27
Count total downloads from GitHub releases using the GitHub API v3 and a simple jq expression
#!/usr/bin/env sh
# https://jqplay.org/s/CpDPlGueMM
# usage: `github-release-downloads.sh Username/Repository`
curl -s https://api.github.com/repos/$1/releases |
jq '[.[].assets | .[].download_count] | add' -

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:[email protected]",
"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)