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
#sample found by @JohnLaTwc | |
#$WebPostTimer = 1200 | |
#$WebGetTimer = 1200 | |
[void] [Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | |
[void] [Reflection.Assembly]::LoadWithPartialName("System.Drawing") | |
function New-Mutex($MutexName) { | |
#[CmdletBinding()][OutputType([PSObject])] | |
#Param ([Parameter(Mandatory)][ValidateNotNullOrEmpty()][string]$MutexName) |
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
<?php | |
foreach ($roundData->getEnemy() as $enemy) { | |
//30% chance to attack a buddy | |
$enemyHp = $enemy->getHp(); | |
while ($enemyHp > 0) { | |
if (rand(1, 100) <= 30) { | |
/** @var \FfrkCentral\Ffrk\Models\Battle\Buddy $randomBuddyToDamage */ | |
$randomBuddyToDamage = $battleData->getBuddy()[array_rand($battleData->getBuddy())]; |
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
<?php | |
if (count($argv) <= 1) { | |
exit(); | |
} | |
array_shift($argv); | |
foreach ($argv as $jsFile) { | |
if (!file_exists($jsFile)) { |
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
def trim(v) | |
v & 0xffffffff | |
end | |
def scramble(v) | |
v ^= 0x1ca7bc5b | |
v *= 0x1ca7bc5b | |
v = trim(v) | |
v = ((v >> 1) & 0x55555555) | trim((v & 0x55555555) << 1) |
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
/* | |
* Original code: Jeffrey Way (https://gist.github.com/JeffreyWay/5112282) | |
* Modified for Laravel 5 and to use closure: soufiane EL HAMCHI (https://gist.github.com/soufianeEL/3f8483f0f3dc9e3ec5d9) | |
* and Ferri Sutanto (https://gist.github.com/ghprod/0bb7f8d207ba7838a0e6) | |
* Uses meta csrfToken and meta csrfParam based on: https://github.com/rails/jquery-ujs/blob/master/src/rails.js | |
* | |
* Examples : | |
* <a href="posts/2" data-method="delete"> | |
* - Or, request confirmation in the process - | |
* <a href="posts/2" data-method="delete" data-confirm="Are you sure?"> |
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
/** | |
* Check if a given ip is in a network | |
* @param string $ip IP to check in IPV4 format eg. 127.0.0.1 | |
* @param string $range IP/CIDR netmask eg. 127.0.0.0/24, also 127.0.0.1 is accepted and /32 assumed | |
* @return boolean true if the ip is in this range / false if not. | |
*/ | |
function ip_in_range( $ip, $range ) { | |
if ( strpos( $range, '/' ) == false ) { | |
$range .= '/32'; | |
} |
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
#!/bin/bash | |
# | |
# | |
# Usage | |
# This script do nothing, it juste show files that are scanned or not by | |
# Logstash and plugin File. 3 outputs | |
# | |
# ./utilSinceDB.sh | |
# ./utilSinceDB.sh | grep "not found in sincedb" | |
# ./utilSinceDB.sh | grep "to delete" |
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
debug> run | |
debugger listening on port 5858connecting... ok | |
breakpoint #1 in #<Object>.[anonymous](exports=#<Object>, require=function require(path) { | |
return Module._load(path, self); | |
}, module=#<Module>, __filename=/Volumes/Fuitad/Documents/www/app.js, __dirname=/Volumes/Fuitad/Documents/www), /Volumes/Fuitad/Documents/www/app.js:1 | |
(function (exports, require, module, __filename, __dirname) { var conf = require('./conf'), | |
^ | |
debug> continue | |
debug> Express server listening on port 3000 in development mode | |
break in [anonymous](req=#<IncomingMessage>, res=#<ServerResponse>, function callbacks(err) { |
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
- (TTStyle*)imageThumbView:(UIControlState)state { | |
TTBoxStyle* boxStyle = [TTBoxStyle styleWithMargin:UIEdgeInsetsMake(4, 4, 4, 4) next:nil]; | |
TTStyle* imageStyle = [TTImageStyle styleWithImageURL:nil | |
defaultImage:nil | |
contentMode:UIViewContentModeScaleAspectFit | |
size:CGSizeZero next:boxStyle]; | |
TTPartStyle* imagePart = [TTPartStyle styleWithName:@"image" style:imageStyle next:nil]; | |
TTStyle* contentStyle = [TTContentStyle styleWithNext:imagePart]; | |
TTStyle* fillStyle = [TTSolidFillStyle styleWithColor:hexColor(0xcccccc) next:contentStyle]; | |
TTStyle* whiteBorder = [TTSolidBorderStyle styleWithColor:hexColor(0xffffff) width:2 next:fillStyle]; |