Skip to content

Instantly share code, notes, and snippets.

View Connicpu's full-sized avatar

Connie Hilarides Connicpu

View GitHub Profile
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Documents;
using Windows.UI.Xaml.Media;
using Cloudsdale_Metro.Helpers;
[HttpPost]
public ActionResult UpdatePrefix(ChangePrefixModel model) {
if (!Request.IsAuthenticated) return RedirectToAction("Login", "Account");
var referer = Request.UrlReferrer ?? new Uri("/");
if (User.Identity.Name != model.User && !CmcsRoleProvider.IsStaff(User.Identity.Name)) {
return Redirect(referer.ToString());
}
if (!ModelState.IsValid)
function an ([string] $hero, [string] $program, [string] $is, [string] $kill)
{
if (($hero -ne "hero") -or ($is -ne "is") -or ($kill -ne "kill"))
{
Write-Host "an hero you is kill" -f Red
return
}
try
{
/*********************************
* CriticalSections.cpp
* Connor Hilarides
* Created 2014/08/07
* Copyright © 2014 DigiPen Institute of Technology, All Rights Reserved
*********************************/
#include "CriticalSections.h"
template <typename T>
class rwlock
{
T obj;
SRWLOCK lock;
class guard
{
rwlock &rwl;
bool mut;
int server_accept(int listener)
{
sockaddr_storage client_address; /* This is big enough to store an IPv4 or IPv6 address */
int address_size = sizeof(client_address);
int socket = accept(listener, &client_address, &address_size);
if (fork())
{
/* close now, it won't stop the connection until
* the child also closes it
Push-Location
Set-Location HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\
if (!(Test-Path "Personalize")) {
New-Item "Personalize"
}
Set-ItemProperty "Personalize" -Name AppsUseLightTheme -Type DWORD -Value 0
Pop-Location
#[derive(TLType)]
pub enum InputPeer {
#[tl_id(_7f3b18ea)]
Empty,
#[tl_id(_7da07ec9)]
SelfPeer,
#[tl_id(_1023dbe8)]
Contact { user_id: i32 },
#[tl_id(_9b447325)]
Foreign { user_id: i32, access_hash: i64 },
async ->
my_result = some_large_calculation()
other_result = {}
await bukkit_sync (->
other_result.value = do_something_on_api(my_result)
), defer()
do_database_save other_result.value
@MaxOwnedBy = (owner) ->
rankNumber = ->
return 3 if SpecialUsers::IsVip owner
return 2 if SpecialUsers::IsVeteran owner
return 1
permsNumber = ->
Permissions::getPlayer(owner).getInfo("js.extraplots", 0, Bukkit.server.getWorld plot_world).integer
return rankNumber() + permsNumber()