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 checkIp() { | |
/** | |
* Deny if not from the following IPs | |
* | |
*/ | |
if (!empty($_SERVER['HTTP_CLIENT_IP'])) { | |
$ip = $_SERVER['HTTP_CLIENT_IP']; | |
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { | |
$ip = $_SERVER['HTTP_X_FORWARDED_FOR']; |
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 | |
class Permission | |
{ | |
static $dictionaryPath = 'clients.php'; | |
/** | |
* Check if the clientId exists in the dictionary | |
* @param $clientId |
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 | |
class News extends Eloquent{ | |
public function scopeLang($query) | |
{ | |
return $query->where('LocalString.lang', LANG); | |
} | |
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
Byblos API enhancements | |
======================= | |
## Version | |
The version of the API should be included in the base URL of the API precedeed with the letter v | |
e.g. `//myapi.com/v1/accounts` | |
## Naming | |
### Use names for resources and verbs for actions | |
Provide sensible **names** for the applications resources |
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
<div ng-show="!item.edit"> | |
<div ng-if="item.row.logo" > | |
<img ng-src="uploads/mdpi/{{item.row.logo}}" style="max-width: 80px;"/> | |
</div> | |
<div ng-if="!item.row.logo"><i>No image selected</i></div> | |
</div> | |
<div class="dropzone"> | |
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 a user myUser with myPassword and assign it to myDb | |
USE [master] | |
GO | |
-- Delete existing login. | |
IF EXISTS (SELECT * FROM sys.server_principals WHERE name = N'myUser') | |
DROP LOGIN [myUser] | |
GO |
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 | |
$i = 0; | |
$col = 5; // number of items per row | |
$width = 100/ $count; | |
$count = count($items) | |
?> | |
<div class="white-box gallery"> | |
<?php foreach($items as $item): ?> | |
<?php if($i % $col === 0): ?> |
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 class HomeController : Controller { | |
private readonly ViewRender view; | |
public HomeController (ViewRender view) { | |
this.view = view | |
} | |
public string Test () { | |
// render ~/Views/Emails/ResetCode |
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 | |
# Sign a file with a private key using OpenSSL | |
# Encode the signature in Base64 format | |
# | |
# Usage: sign <file> <private_key> | |
# | |
# NOTE: to generate a public/private key use the following commands: | |
# | |
# openssl genrsa -aes128 -passout pass:<passphrase> -out private.pem 2048 | |
# openssl rsa -in private.pem -passin pass:<passphrase> -pubout -out public.pem |
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(angular) { | |
'use strict'; | |
/* | |
Usage: | |
----- | |
FILE --app.js-- | |
OlderNewer