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
for (Map.Entry<String, Set<String>> rule : rules.entrySet()) { | |
String key = rule.getKey(); | |
Set<String> value = rule.getValue(); | |
for (String temp : value) { | |
System.out.println("Scope: " + key + ", rule: " + temp); | |
} | |
} |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<Configuration status="WARN"> | |
<Appenders> | |
<File name="console" filename="log/console.log" immediateFlush="true"> | |
<PatternLayout pattern="[%d{dd/MM/YYYY HH:mm:ss}]%n%msg%n" /> | |
<ThresholdFilter level="ERROR" onMatch="ACCEPT" onMismatch="DENY" /> | |
</File> | |
<File name="requests" filename="log/requests.log" immediateFlush="true"> | |
<PatternLayout pattern="%d{dd/MM/YYYY HH:mm:ss} - %msg%n" /> | |
<ThresholdFilter level="INFO" onMatch="ACCEPT" onMismatch="DENY" /> |
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
public static int pack(byte[] bytes) { | |
int val = 0; | |
for (byte oneByte : bytes) { | |
val <<= 8; | |
val |= oneByte & 0xff; | |
} | |
return val; | |
} | |
public static short[] unpack(int bytes) { |
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
CREATE TABLE people ( | |
id NUMBER NOT NULL, | |
name VARCHAR(56), | |
last_name VARCHAR(56), | |
dob DATE, | |
graduation_date DATE, | |
created_at TIMESTAMP, | |
updated_at TIMESTAMP) | |
ALTER TABLE people ADD CONSTRAINT people_pk PRIMARY KEY ( id ) |
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
//SearchController.php | |
public function autocomplete(){ | |
$term = Input::get('term'); | |
$results = array(); | |
$queries = DB::table('users') | |
->where('first_name', 'LIKE', '%'.$term.'%') | |
->orWhere('last_name', 'LIKE', '%'.$term.'%') | |
->take(5)->get(); |
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
$reflectionMethod = new ReflectionMethod('Auth::routes'); | |
print $reflectionMethod->getFileName() . ':' . $reflectionMethod->getStartLine(); |
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
"git checkout ." - delete local changes | |
"git config --global credential.helper wincred" - save credentials | |
git checkout --ours . | |
git checkout --theirs . | |
To remove untracked files / directories do: | |
git clean -fdx | |
-f - force | |
-d - directories too | |
-x - remove ignored files too ( don't use this if you don't want to remove ignored files) |
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 | |
Artisan::command('inspire', function () { | |
$this->comment(Inspiring::quote()); | |
})->describe('Display an inspiring quote'); |
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
AuthType Basic | |
AuthName "Login please" | |
AuthUserFile "/home/sumdu/dias.team/dvv/.htpasswd" | |
Require valid-user |
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
public function changePassword() | |
{ | |
try { | |
$user = User::findOrFail(request()->input('id')); | |
if (Hash::check(request()->input('password'), $user->password)) { | |
throw ValidationException::withMessages([ | |
'password' => ['translation.newPasswordMustBeDifferent'] | |
]); | |
} |
OlderNewer