- Create your bot with botfather
- Make you bot an admin of your channel
Go to Telegram web and open a channel, get the ID from -[channel id] from hash in the path
https://web.telegram.org/k/#-9999999999999
<?php | |
use Illuminate\Support\Arr; | |
trait CanBeReplicated | |
{ | |
public function replicateTo(string $model, array $with = null, array $except = null) | |
{ | |
$defaults = [ | |
$this->getKeyName(), |
extension String { | |
/* | |
Truncates the string to the specified length number of characters and appends an optional trailing string if longer. | |
- Parameter length: Desired maximum lengths of a string | |
- Parameter trailing: A 'String' that will be appended after the truncation. | |
- Returns: 'String' object. | |
*/ | |
func trunc(length: Int, trailing: String = "…") -> String { | |
return (self.count > length) ? self.prefix(length) + trailing : self |
<?php | |
if ( isset($_POST['payload']) && $_POST['payload'] ) { | |
echo shell_exec('cd /var/www/mydrupal/ && sudo -u myuser git pull'); | |
echo shell_exec('cd /var/www/mydrupal/sites/all/themes/mytheme/ && sudo -u myuser node ./node_modules/gulp/bin/gulp.js mygulptask'); | |
// Adding the drush will cause the delivery being displayed as unsuccessful. Means GitHub doesn't wait so long. The command will run nevertheless. | |
echo shell_exec('cd /var/www/mydrupal/ && sudo -u myuser drush @sites cc all -y'); | |
} | |
// Should return www-data |
Observable.fromCallable(() -> { | |
Request request = new Request.Builder() | |
.url(url) | |
.build(); | |
try { | |
Response response = sHttpClient.newCall(request).execute(); | |
return response.isSuccessful(); | |
} catch (IOException e) { | |
Log.e("Network request", "Failure", e); | |
} |
<?php | |
namespace App\Http\Middleware; | |
use Closure; | |
use Illuminate\Http\Response; | |
/** | |
* Validate Mailgun Webhooks | |
* @see https://documentation.mailgun.com/user_manual.html#securing-webhooks |
<?php | |
class StaticCorsValetDriver extends BasicValetDriver | |
{ | |
/** | |
* Determine if the driver serves the request. | |
* | |
* @param string $sitePath | |
* @param string $siteName | |
* @param string $uri |
Note: This setup assumes you are running Ubuntu 16.04 OS with Apache 2.4.23, older versions of Ubuntu (i.e. 14.04) require minor configuration changes in order for this setup to work.
Follow the install instructions for certbot
(letsencrypt's SSL manager) on https://certbot.eff.org/, making sure to select the correct server OS version.
Note: You only need to complete the Install
section, then return to this README in order to setup your SSL
#!/bin/bash | |
killall Xcode | |
xcrun -k | |
xcodebuild -alltargets clean | |
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache" | |
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache" | |
rm -rf ~/Library/Developer/Xcode/DerivedData/* | |
rm -rf ~/Library/Caches/com.apple.dt.Xcode/* | |
open /Applications/Xcode.app |