New Snippet
$url = 'http://server.com/path';
$data = array('key1' => 'value1', 'key2' => 'value2');
// use key 'http' even if you send the request to https://...
$options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'content' => http_build_query($data)
)
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
if ($result === FALSE) { /* Handle error */ }
var_dump($result);// URL to verify reCaptcha was successful
$url = 'https://www.google.com/recaptcha/api/siteverify';
// Parameters to pass in POST
$g_response = $_POST['g-recaptcha-response'];
$g_secret = 'yourSecretHere';
$data = array(
'secret' => $g_secret,
'response' => $g_response,
);
// config context options
$options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'content' => http_build_query($data)
)
);
// create context and get result
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
// Check if valid result from reCaptcha verification
if ($result === FALSE) {
// bad request handler
} else {
// decode response to JSON
$g_result = json_decode($result);
// Check if reCaptcha was validated
if (!$g_result->success) {
// bad reCaptcha handler
}
// Let page load normally if reCaptcha was successfully validated.
}// Build parameters for API query.
$params = [
'wsfunction' => 'core_enrol_get_users_courses',
'moodlewsrestformat' => 'json',
'userid' => $userID,
];
// Add the moodle token to the request
$params['wstoken'] = env('MOODLE_TOKEN', 'moodle_token');
// Build the request URL
$url = rtrim(env('MOODLE_URL'), '/') .
'/webservice/rest/server.php?' .
http_build_query($params);
file_get_contents($url, false, stream_context_create([
'ssl' => [
'verify_peer' => false,
'verify_peer_name' => false
]
]));function addSource($source)
{
$data = $this->data;
$arr = [];
if(isset($this->data['target'])) $arr = $data['target'];
array_push($arr, $source);
$data['target'] = $arr;
$this->data = $data;
$this->save();
}'constraints' => array(
new Callback(function($zip, ExecutionContextInterface $context) {
$addressType = $context->getObject()->getParent()['summ_address_type']->getData();
if($addressType == "Domestic" && !$zip) {
$context->buildViolation('A zipcode is required for domestic addresses.')->addViolation();
}
})
)$s3Client = S3Client::factory(array(
'region' => $region,
'credentials' => array(
'key' => $key,
'secret' => $secret
)
));$file = $request->files->get('fileInput');
$documentName = 'thisfile.ext'; // based on framework, methods for getting name will vary
$fileName = time() . $documentName; // ensuring minimal chance of duplicate file names in bucket
$bucket = $this->getParameter('aws_config')['bucket'];
$s3Client = $this->getS3Client();
$s3Client->putObject(array(
'Bucket' => $bucket,
'Key' => $fileName,
'Body' => fopen($file, 'r+'),
'Metadata' => array()
));#!/bin/bash
# Check for w3m install on Mac
install=0;
command -v w3m >/dev/null || {
install=1
echo >&2 "I require w3m but it's not installed. Install? (Y/n)"
}
if [ "$install" = "1" ]
then
read userAnswer
if [ "$userAnswer" = "Y" ]
then
echo "installing w3m"
command -v brew update >/dev/null || {
echo >&2 "I require brew to install w3m. Please install homebrew."
break
}
brew install w3m
w3m -dump weather.dennissauve.com | sed -n 13,20p
else
echo "aborting"
fi
else
w3m -dump weather.dennissauve.com | sed -n 13,20p
fi
kill $(ps aux | grep '[p]hp' | awk '{print $2}')Host example
User exampleuser
HostName cloud.example.com
IdentityFile ~/.ssh/exampleKeyFile.pemsudo "/Library/Application Support/VirtualBox/LaunchDaemons/VirtualBoxStartup.sh" restart59 23 30 9 * ~/scripts/wake.sh.button:focus{
outline: none;
}.main-header {
display: inline-block;
position: absolute;
left: 50%;
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
}body {
-webkit-print-color-adjust: exact;
}<[^>]*># Force HTTPS
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]constructor( private offenseCategoryApiService : OffenseCategoriesApiService) {
this.offenseCategoryApiService.getAll().toPromise().then();@ViewChild('noRecordsTemplate', {static: false}) noRecordsTemplate;
noDataMessage = "<br/><br/>";
isDataLoading: boolean = false;
this.isDataLoading = true;
this.noDataMessage = result.total == 0 ? "No Records to Display" : "<br/><br/>";
this.isDataLoading = false;
@Component({
selector: 'app-my-form',
template: `
<div class="grid-wrapper">
<form>...</form>
<div *ngIf="isLoading" class="k-i-loading"></div>
</div>`,
styles: [`
.grid-wrapper {
position: relative;
}
.k-i-loading {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
font-size: 64px;
background-color: rgba(255,255,255,.3);
color: #ff6757;
}
`]
})
export class MyFormComponent {
private isLoading;
// Whenever you're done loading
this.isLoading = false;
}let editForm = new FormGroup({
formControlName: new FormControl(defaultItem, Validators.required),
});import { HttpClient } from "@angular/common/http";
import { saveAs } from "file-saver";
@Injectable()
export class ApiService {
constructor(
private http: HttpClient
) {
}
getFile(path: string): void {
const url = `${environment.apiUrl}${path}`;
// cast to json make interpreter happy, @see https://github.com/angular/angular/issues/18586
const options = { responseType: 'blob' as 'json' };
const req = this.http.get<Blob>(url, options);
req.subscribe((data) => {
saveAs(data, 'info');
});
}
}// Must be passed a ViewChild.nativeElement
isInViewport(elem) {
let bounding = elem.getBoundingClientRect();
return (
bounding.top >= 0 &&
bounding.left >= 0 &&
bounding.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&
bounding.right <= (window.innerWidth || document.documentElement.clientWidth)
);
};getDateTimeDiff(a: string, b: string) {
let aTime = new Date(a);
let bTime = new Date(b);
let diff = Math.floor((aTime.getTime() - bTime.getTime()) / 1000);
let days = Math.floor(diff / 86400);
diff = diff - (days * 86400);
let hours = Math.floor(diff / 3600);
diff = diff - (hours * 3600);
let minutes = Math.floor(diff / 60);
diff = diff - (minutes * 60);
return `${days.toString()}:${hours.toString()}:${minutes.toString()}:${diff.toString()}`;
}// n is the number of emits from the subscription
const n = 1
await subscription.take(n).toPromise();var allErrors = ModelState.Values.SelectMany(v => v.Errors.Select(b => b.ErrorMessage));<kendo-grid [data]="yourData" [loading]="isDataLoading">
<ng-template #noRecordsTemplate kendoGridNoRecordsTemplate>
<div [innerHTML]="noDataMessage"></div>
</ng-template>
...
</kendo-grid><kendo-grid-column>
<ng-template kendoGridCellTemplate let-dataItem>
<a style="text-decoration: underline" [routerLink]="[dataItem.id]+'/edit'">{{ dataItem.id }}</a>
</ng-template>
</kendo-grid-column><style>
@media print {
.pagebreak {
clear: both;
page-break-after: always;
}
}
</style>
<!-- page 1 content here -->
<div class="pagebreak"></div>
<!-- page 2 content here -->foreach (var filter in apiRecordRequest.Filter.Filters)
{
if (filter.Field == "id")
{
query = query.Where(x => x.Id == id);
}
// ... and so on and on
}select t.table_schema,
t.table_name
from information_schema.tables t
inner join information_schema.columns c on c.table_name = t.table_name
and c.table_schema = t.table_schema
where c.column_name = 'last_name'
and t.table_schema not in ('information_schema', 'pg_catalog')
and t.table_type = 'BASE TABLE'
order by t.table_schema;Hello,
* FTP MP3 server and direct download of everything: https://www.0daymusic.org/premium.php
* Resellers: PayPal, VISA, Bank Transfer, Bitcoin, Mastercard, Amazon Pay, WebMoney...
* FTPtxt-16 software: https://www.0daymusic.org/FTPtxt for text search.
* Server capacity: 440 TB MP3, FLAC, labels, music videos.
* Supports: FTP, FTPS (File Transfer Protocol Secure), SFTP, and HTTP, HTTPS.
* Daily updates: 30-100 GB, 300-2000 albums, web, promo, CDM, CDR, CDS, EP, LP, vinyl...
* Unlimited download speed.
* Files available anytime.
* Over 17 years of archive.
* Total server speed: 1 Gbps.
* User-friendly. Most genres are sorted by day.
0-DAY TEAMGet free Blockchain Insurance globally!
Get professional insurance of global importance from an insurer in Chelyabinsk, Russia.
Without personal data, cookie and JS.
We got access to the US market without compromising.
More than 85 types of non-criminal insurance.
Once a month, a document is created that can be shown to the regulatory authorities. We're taking over the negotiations.
We insure risks such as:
1. Arbitrary legislation
2. Arbitrariness of the Central Bank
3. Possible harm to other people
Link (own hosting): http://78.29.53.57/freeinsurance/?s1=xrum
http://78.29.53.57/freeinsurance/?s1=xrum
By brand ChelyabinskMAN