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
#!/usr/bin/env bash | |
# Use this one-liner to produce a JSON literal from the Git log: | |
git log \ | |
--pretty=format:'{%n "commit": "%H",%n "author": "%an <%ae>",%n "date": "%ad",%n "message": "%f"%n},' \ | |
$@ | \ | |
perl -pe 'BEGIN{print "["}; END{print "]\n"}' | \ | |
perl -pe 's/},]/}]/' |
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 | |
/* | |
* 1. Add this file to libraries folder | |
* 2. Extend the Mongo_model class in your models (models directory) example: class User_model extends Mongo_model | |
* 3. add protected statis $collectionName = 'here the name of your mongo collection'; | |
* 4. Load it in your controller, example: Mongo_model::load('user_model'); | |
*/ | |
class Mongo_Model | |
{ | |
protected static $collectionName; |
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
import re | |
def transform(input): | |
HTMLoutput = "" | |
for line in input.splitlines(): | |
HTMLoutput = re.findall(r"(\w+)(\s+)(:)", line) | |
return HTMLoutput #return behen krejt qe jan be match |
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
<script> | |
function dowiki(place) { | |
var URL = 'https://en.wikipedia.org/w/api.php?format=json&action=query&prop=extracts&exintro=&explaintext='; | |
URL += "&titles=" + place; | |
URL += "&rvprop=content"; | |
URL += "&callback=?"; | |
$.getJSON(URL, function (data) { | |
var obj = data.query.pages; | |
var ob = Object.keys(obj)[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
<?php | |
namespace App\Classes; | |
use Illuminate\Pagination\LengthAwarePaginator; | |
class Datatables{ | |
public static function of($query, $queryset){ | |
//accept only the parameters inside this array | |
$params = $queryset->only(['sortBy', 'sortDirection','pageIndex','pageSize','searchBy','filterBy','filterWhere','filterValue']); | |
//check if filtering is enabled |
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 | |
namespace App\Support; | |
use Validator; | |
trait FilterPaginateOrder { | |
protected $operators = [ | |
'equal_to' => '=', | |
'not_equal' => '<>', | |
'less_than' => '<', | |
'greater_than' => '>', | |
'less_than_or_equal_to' => '<=', |
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
image: atlassian/default-image:2 | |
pipelines: | |
branches: | |
master: | |
- parallel: | |
- step: | |
name: "Zip the web code" | |
script: | |
- zip -r your-application.zip . -x "vendor/*" |
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
RUN docker-php-ext-install opcache | |
RUN docker-php-ext-install pcntl | |
COPY .docker/php/php.ini /usr/local/etc/php | |
COPY .docker/php/opcache.ini /usr/local/etc/php/conf.d/opcache.ini | |
COPY start.sh /usr/local/bin/start | |
RUN chown -R www-data:www-data /var/www/html \ | |
&& chmod u+x /usr/local/bin/start \ | |
&& a2enmod rewrite | |
COPY . /var/www/html |
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
version: "3" | |
services: | |
app: | |
container_name: projectname | |
build: . | |
depends_on: | |
- mysql | |
ports: | |
- "8000:80" | |
- "4433:443" |
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
#!/usr/bin/env bash | |
set -e | |
role=${CONTAINER_ROLE:-app} | |
env=${APP_ENV:-production} | |
if [ "$role" = "app" ]; then | |
exec apache2-foreground |