This file contains hidden or 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
// Not valid | |
namespace Boilerplate | |
{ | |
public boilerplate BCompareOperators<T> | |
{ | |
bool operator >(T lhs, T rhs) => lhs.CompareTo(rhs) > 0; | |
bool operator <(T lhs, T rhs) => lhs.CompareTo(rhs) < 0; | |
bool operator >=(T lhs, T rhs) => lhs.CompareTo(rhs) >= 0; | |
bool operator <=(T lhs, T rhs) => lhs.CompareTo(rhs) <= 0; |
This file contains hidden or 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
protected virtual void OrderVotes() | |
{ | |
int priorValue = 0; | |
Votes.Sort(); | |
/* One vote, always rank 1 */ | |
if (Votes.Count >= 1 && Votes[0].Value != 1) | |
{ | |
priorValue = Votes[0].Value; | |
Votes[0] = new Vote(Votes[0].Candidate, 1); | |
} |
This file contains hidden or 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
# Quick MariaDB container listening on localhost:3306 | |
db: | |
image: mariadb:10.1 | |
ports: | |
- localhost:3306:3306 | |
volumes: | |
/opt/containers/mariadb/data/db:/var/lib/mysql | |
/opt/containers/mariadb/conf/mariadb/my.cnf:/etc/my.cnf:ro | |
restart: always |
This file contains hidden or 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
hashOut.data = hashes + SSL_MD5_DIGEST_LEN; | |
hashOut.length = SSL_SHA1_DIGEST_LEN; | |
if ((err = SSLFreeBuffer(&hashCtx)) != 0) | |
goto fail; | |
if ((err = ReadyHash(&SSLHashSHA1, &hashCtx)) != 0) | |
goto fail; | |
if ((err = SSLHashSHA1.update(&hashCtx, &clientRandom)) != 0) | |
goto fail; | |
if ((err = SSLHashSHA1.update(&hashCtx, &serverRandom)) != 0) | |
goto fail; |
This file contains hidden or 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 UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
using BlackCore.GameWorld; | |
namespace BlackCore.GameWorld | |
{ |
This file contains hidden or 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
class WCMFTPUser(Base): | |
"""WCM FTP Users table""" | |
__tablename__ = 'user' | |
username = Column(String(50), nullable=False, unique=True) | |
password = Column(String(255), nullable=False) | |
uid = Column(Integer, primary_key=True, nullable=False) | |
gid = Column(Integer, nullable=False) | |
homedir = Column(String(1024), nullable=False, default='/var/www/content') | |
shell = Column(String(255), nullable=False, default='/sbin/nologin') |
This file contains hidden or 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
#!/bin/env python | |
# Loads the configuration | |
from ConfigParser import ConfigParser | |
class Configuration: | |
"""Convenience class to load our configuration file""" | |
__default_config_file = '/etc/wcm/wcm.ini' |
This file contains hidden or 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
if date <= x.lastplay: | |
if verbose: | |
print 'Current date is not newer than logged!' | |
if force: | |
print 'Forcing anyway.' | |
else | |
print 'Skipping entry.' | |
if not force: | |
session.rollback() | |
continue |
This file contains hidden or 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
#!/bin/env python | |
import pyawk | |
pa = pyawk.Awk(fs='\w+') | |
def cpu_num(pa): | |
pa.global[numprocs] = int(pa.field[3]) | |
def cpu_end(pa): |
This file contains hidden or 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
httpd -fstype=nfs,soft,tcp,vers=3,fsc,intr,nolock web-storage:/web/httpd |