Skip to content

Instantly share code, notes, and snippets.

View touhidurabir's full-sized avatar
🏠
Working from home

Touhidur Rahman touhidurabir

🏠
Working from home
View GitHub Profile
@touhidurabir
touhidurabir / how-to-use.md
Last active January 16, 2023 10:50
Tinkerwell bootstrapping for PKP(https://pkp.sfu.ca/) OJS/OMP/OPS apps

How to Use

Put the pkp-tinkerwell-bootstrap.php in the root of application(OPS/OMP/OJS).

Or can be put in any folder, In that case , the first line where the const APP_ROOT_PATH defined, need to update such as

// Considering the file pkp-tinkerwell-bootstrap.php in a directory of app root path e.g pkp-tinkerwell
define('APP_ROOT_PATH', realpath(dirname(__FILE__) . '/..'));
#!/bin/sh
daemon=beanstalkd
executable=/usr/local/bin/$daemon
port=11300
waldir=/usr/local/var/beanstalkd
logfile=/usr/local/var/log/beanstalkd.log
interface="127.0.0.1"
params="-l $interface -p $port -b $waldir"
@touhidurabir
touhidurabir / 0_reuse_code.js
Last active August 29, 2015 14:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<?php
// KNAPSACK BALANCER!
class Balancer
{
public static function balance($items, $key)
{
$result = array();
$maxWeight = floor(self::sum($items, $key) / 2);
/**
* Filter to check for CSRF attacks from the ajax requests.
*/
Route::filter('csrf_header', function()
{
if (Session::token() != Request::header('x-csrf-token'))
{
throw new Illuminate\Session\TokenMismatchException;
}
});