Skip to content

Instantly share code, notes, and snippets.

Charles Pigott LordAro

Block or report user

Report or block LordAro

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@LordAro
LordAro / URYAuthenticatorPluggable.php
Created Feb 25, 2019
PluggableAuth Mediawiki auth plugin for URY
View URYAuthenticatorPluggable.php
<?php
use \MediaWiki\Auth\AuthManager;
class URYAuthenticator extends PluggableAuth {
const API_KEY = '<snip>';
const API_ROOT = 'https://ury.org.uk/api/';
private function myradioAPIRequest($path, $params = [], $method = 'GET') {
View with-open.py
try:
with open("foo.txt") as f:
for l in f:
print(l)
print("and some other stuff")
print("enough stuff that a list comprehension is unfeasible")
except EnvironmentError as e:
print(f"Oh no: {e}")
View base.css
html {
background-color: #AB9C7D;
color: black;
font-family: "Trebuchet MS", Arial, Verdana, Sans-Serif;
font-size: 12px;
}
body {
width: 800px;
margin: auto auto;
View what.adb
with Ada.Text_IO;
procedure Learn is
type Integer_Array is array (Natural range <>) of Integer;
b : Integer_Array := (1,2,3);
a : Integer_Array := (4,5,6);
begin
if b(0..2) < a(1..2) then
Ada.Text_IO.Put_Line ("HELLO");
end if;
View stringfmt.cpp
#include <iostream>
#include <type_traits>
#include <vector>
template<typename, typename = void>
struct is_std_container : std::false_type {};
template<typename T>
struct is_std_container<T,
View cppcheck.txt
[src/3rdparty/squirrel/squirrel/sqclass.h:10]: (performance) Variable 'val' is assigned in constructor body. Consider performing initialization in initialization list.
[src/3rdparty/squirrel/squirrel/sqclass.h:11]: (performance) Variable 'attrs' is assigned in constructor body. Consider performing initialization in initialization list.
[src/3rdparty/squirrel/squirrel/sqclosure.h:10]: (performance) Variable '_function' is assigned in constructor body. Consider performing initialization in initialization list.
[src/3rdparty/squirrel/squirrel/sqclosure.h:48]: (performance) Variable '_closure' is assigned in constructor body. Consider performing initialization in initialization list.
[src/3rdparty/squirrel/squirrel/sqcompiler.cpp:664]: (portability) Casting from float* to integer* is not portable due to different binary data representations on different platforms.
[src/3rdparty/squirrel/squirrel/sqcompiler.cpp:710]: (portability) Casting from float* to integer* is not portable due to different binary data represe
View postfix.c
#include <stdio.h>
int main(void) {
int someValue = 1;
int x = 10, y = 10;
someValue ? ++x, ++y : --x, --y;
printf("%d %d\n", x, y);
return 0;
View soln.cpp
#include <algorithm>
#include <functional>
#include <iostream>
#include <string>
#include <vector>
template <int N>
int plus(int i)
{
return i + N;
View jukeboxsched_timing.txt
122.42794036865ms
47.846794128418ms
226.38607025146ms
105.95703125ms
194.10586357117ms
60.943126678467ms
182.0080280304ms
174.10182952881ms
103.69205474854ms
44.697999954224ms
View industry_cmd.cpp
/* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file industry_cmd.cpp Handling of industry tiles. */
You can’t perform that action at this time.