This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Before: | |
public static function getTeamUsers($Team){ | |
if(!static::checkvar($Team,'id')) | |
{ | |
return false; | |
} | |
$sql = static::conn(); | |
$sel = $sql->prepare("SELECT TeamMembers.UserID AS User FROM TeamMembers WHERE TeamMembers.TeamID = ?"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <stdio.h> | |
#include <winsock2.h> | |
#pragma comment(lib,"ws2_32.lib") | |
int main(int argc, char** argv) | |
{ | |
WSADATA WsaDat; | |
WSAStartup(MAKEWORD(2,2),&WsaDat); | |
SOCKET Socket=socket(AF_INET,SOCK_STREAM,IPPROTO_TCP); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Creep.prototype.findNearestStorage: function() { | |
var pref = undefined; | |
if (this.room.storage != undefined) { | |
pref = this.room.storage; | |
} | |
for (var link in this.room.memory.energy.linkSources) { | |
var l = Game.getObjectById(link); | |
if (l != null && this.pos.getRangeTo(pref) > this.pos.getRangeTo(l)) { | |
pref = l; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using LiteDB; | |
namespace LiteDB.Extensions { | |
public static class LiteCollectionX { | |
/// <summary> | |
/// Upserts the specified value. | |
/// </summary> | |
/// <typeparam name="T"></typeparam> | |
/// <param name="collection">The collection within which to upsert the <paramref name="value"/>.</param> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Text; | |
namespace FlashFormatting { | |
public static class EnumerableX { | |
//"today is nice".Span<char>(x => x != ' ') => (['t','o','d','a','y'], [' ','i','s',' ','n','i','c','e']) | |
public static Tuple<T[], T[]> Span<T>(this IEnumerable<T> chain, Predicate<T> qualifier) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import * | |
class Athlete: | |
def __init__(self, mass: float, strength: float): | |
self.Mass = mass | |
self.Strength = strength | |
def __hash__(self): | |
return hash((self.Mass, self.Strength)) | |
def __lt__(self, other): | |
return (self.Mass, self.Strength) < (other.Mass, other.Strength) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cmath> | |
#include <cstdio> | |
#include <vector> | |
#include <iostream> | |
#include <algorithm> | |
#include <stdexcept> | |
#include <memory> | |
using namespace std; | |
typedef unsigned int uint; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.annotation.tailrec | |
import scala.collection.mutable.ListBuffer | |
import scala.language.postfixOps | |
import scala.math._ | |
import scala.math.Ordering._ | |
import scala.math.Ordered._ | |
//MIN HEAP | |
def makeMutable[T](in: Seq[T]): ListBuffer[T] = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Github - Flip Comparison | |
// @namespace http://dessix.net/userscripts/github/flip | |
// @version 0.1 | |
// @updateURL https://gist.github.com/Dessix/d1d4c4090f4348cf030ec61977952898/raw/GithubFlipComparison.user.js | |
// @description Flip github branches in comparison. | |
// @author Dessix | |
// @match *://github.com/*/*/compare/*...* | |
// @grant none | |
// @require https://code.jquery.com/jquery-3.1.1.slim.min.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.AbstractTypeExtended$2E$get_prop = exports.TypeModule = undefined; | |
var _Symbol2 = require("fable-core/umd/Symbol"); | |
var _Symbol3 = _interopRequireDefault(_Symbol2); |
OlderNewer