sudo add-apt-repository ppa:certbot/certbot
sudo apt install python-certbot-nginx
If dkpg lock issue appears:
lsof /var/lib/dpkg/lock
ps cax | grep PID
// Add code on the Code section of the layout file. | |
function onInit() { | |
Event::listen('rainlab.user.login', function($user) { | |
// If the user doesn't have a Customer model it was created via the backend. | |
// Make sure to add the Customer model now | |
if ( ! $user->customer && ! $user->is_guest) { | |
$customer = new \OFFLINE\Mall\Models\Customer(); | |
$customer->firstname = $user->name; | |
$customer->lastname = $user->surname; | |
$customer->user_id = $user->id; |
<?php | |
/** | |
* Valet Driver equivalent of http://www.tweaktalk.net/60/nginx-remove-php-file-extension-from-url | |
*/ | |
class LocalValetDriver extends LaravelValetDriver | |
{ | |
/** | |
* Ensure only files which have a .php file on disk get served by this driver. | |
*/ |
// Visit https://eztv.io/showlist/rating/ and sort by rating. Then execute code to remove the ones which have votes lesser than N | |
// Here N is 100000 | |
$('html body div#header_holder table.forum_header_border tbody tr td.forum_thread_post span').filter((id, node) => { | |
return parseInt(String(node.firstChild.nodeValue).replace(',','').replace(/\((\d+) votes\)/, '$1'), 10) < 100000; | |
}).each((id, node) => { | |
node.parentNode.parentNode.style.display = 'none'; | |
}); |
// Add this script as Public/custom-elements/wix-lazy-image.js (yes, create a folder called custom-elements) | |
// In your Wix page, add the Custom Element, choose Corvid file and select the file which you saved in above step. | |
// Now set Tag Name as lazy-image and save. Now, press Set Attributes and add a field called src with the correct URL of image. | |
const addLazyScript = () => { | |
const script = document.createElement('script'); | |
script.src = 'https://cdnjs.cloudflare.com/ajax/libs/lazysizes/5.2.2/lazysizes.min.js'; | |
script.async = true; | |
return script; | |
} |
/* Usage | |
* waterfall(this, [Promise1, Promise2, ...]) | |
* .fail(function(reason){ | |
* console.log('failed') | |
* }) | |
*/ | |
export function waterfall(...params) { | |
var steps = [], | |
dfrd = new Deferred(), |
// Run thro' browser JS console | |
$('#main_table_countries_today > tbody:nth-child(2) > tr').each(function(item) { | |
var total = parseInt($(this).children('td:nth-child(2)').text().replace(/,/g, ''), 10); | |
var active = parseInt($(this).children('td:nth-child(7)').text().replace(/,/g, ''), 10); | |
var deadCases = parseInt($(this).children('td:nth-child(4)').text().replace(/,/g, ''), 10); | |
var recOrDead = total - active; | |
$(this).append('<td>' + ((deadCases / recOrDead) * 100).toFixed(3) + '</td>'); | |
}); |
// SublimeLinter Settings - User | |
// Make sure to drop phpcs.xml at HOME directory. | |
{ | |
"linters": { | |
"phpcs": { | |
"args": "--standard='~/phpcs.xml'", | |
"styles": [ | |
{ | |
"icon": "circle" | |
} |
new file: .gitignore | |
new file: app/.gitignore | |
new file: app/build.gradle | |
new file: app/proguard-rules.pro | |
new file: app/src/main/AndroidManifest.xml | |
new file: app/src/main/java/com/acme/MainActivity.kt | |
new file: app/src/main/res/drawable-v24/ic_launcher_foreground.xml | |
new file: app/src/main/res/drawable/ic_launcher_background.xml | |
new file: app/src/main/res/layout/activity_main.xml | |
new file: app/src/main/res/layout/content_main.xml |
sudo add-apt-repository ppa:certbot/certbot
sudo apt install python-certbot-nginx
If dkpg lock issue appears:
lsof /var/lib/dpkg/lock
ps cax | grep PID
public function download(Request $request, $clintId, $dtId, $inId) | |
{ | |
$path = $request->input('dropbox_file_path'); | |
$downloadFileName = basename($path); | |
$cheaders = [ | |
'Authorization: Bearer ' . env('DROPBOX_BEARER_TOKEN'), | |
'Content-Type: text/plain', | |
'Dropbox-API-Arg: {"path":"$path"}' | |
]; |