Skip to content

Instantly share code, notes, and snippets.

View andrejuseu's full-sized avatar

Andrejus andrejuseu

View GitHub Profile
@johnkary
johnkary / WSSoapClient.php
Created June 27, 2012 20:08
WS-Security for PHP SoapClient
<?php
/**
* Copyright (c) 2007, Roger Veciana
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
@chill117
chill117 / HostNameRouter.php
Last active April 20, 2024 14:10
Manage multiple hostnames (domains, sub-domains) within a single instance of CodeIgniter.
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/*
Manage multiple hostnames (domains, sub-domains) within a single instance of CodeIgniter.
Example:
If you had the following domain/sub-domain style for your site:
your-domain.com
@rxaviers
rxaviers / gist:7360908
Last active July 26, 2024 06:58
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@ryandemmer
ryandemmer / gist:13c742e547bc8cba6d51
Last active May 20, 2017 12:04
VIES VAT Validator
public function validateVAT($code, $vat) {
if ($code === "GR") {
$code = "EL";
}
try {
$client = @new SoapClient("http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl");
} catch (SoapFault $e) {
return -1;
}
@256cats
256cats / composer.json
Last active May 28, 2024 19:18
Web scraping ReactPHP Curl Proxies, curl multi example, scraping news ycombinator, explanation here: http://256cats.com/fast-scraping-with-reactphp-curl-proxies/
{
"require": {
"khr/react-curl": "~2.0",
"sunra/php-simple-html-dom-parser": "~1.5"
}
}
<html>
<head>
<title>Step progress bar</title>
<style type="text/css">
.container {
width: 100%;
}
.progressbar {
counter-reset: step;
}
@hardiksondagar
hardiksondagar / index.html
Last active March 7, 2018 12:27
Chrome desktop Notification example
<button onclick="notifyMe()">Notify me!</button>
@evaqas
evaqas / skaiciai_zodziais.php
Last active June 23, 2023 11:48
Skaičiai žodžiais, suma žodžiais
<?php
function skaicius_zodziais( $skaicius ) {
// neskaiciuosim neigiamu ir itin dideliu skaiciu (iki milijardu)
if ( $skaicius < 0 || strlen( $skaicius ) > 9 ) return;
if ( $skaicius == 0 ) return 'nulis';
$vienetai = array( '', 'vienas', 'du', 'trys', 'keturi', 'penki', 'šeši', 'septyni', 'aštuoni', 'devyni' );
@visitdigital
visitdigital / webhook.php
Last active September 20, 2022 02:51
Very Simple Facebook Chat Bot PHP Webhook Script Example
<?php
$challenge = $_REQUEST['hub_challenge'];
$verify_token = $_REQUEST['hub_verify_token'];
// Set this Verify Token Value on your Facebook App
if ($verify_token === 'testtoken') {
echo $challenge;
}
$input = json_decode(file_get_contents('php://input'), true);
@oquirozm
oquirozm / .gitlab-ci.yml
Created May 18, 2017 10:27
This is a .yml file to setup up ftp deployment in GitLab. Super awesome. Remember to set up the environmental variables.
deploy:
script:
- apt-get update -qq && apt-get install -y -qq lftp
- lftp -c "set ftp:ssl-allow no; open -u $USERNAME,$PASSWORD $HOST; mirror -Rnev --ignore-time --parallel=10 --exclude-glob .git* --exclude .git/"
only:
- master