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.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; |
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
[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) |
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
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 | |
{ |
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
/********************************* | |
* CriticalSections.cpp | |
* Connor Hilarides | |
* Created 2014/08/07 | |
* Copyright © 2014 DigiPen Institute of Technology, All Rights Reserved | |
*********************************/ | |
#include "CriticalSections.h" |
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
template <typename T> | |
class rwlock | |
{ | |
T obj; | |
SRWLOCK lock; | |
class guard | |
{ | |
rwlock &rwl; | |
bool mut; |
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
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 |
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
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 |
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
#[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 }, |
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
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 |
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
@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() |
OlderNewer