Put SearchTrait.php
in app
directory. Then use SearchTrait
in your model, like so
use App\SearchTrait;
use Illuminate\Database\Eloquent\Model;
class Article extends Model
{
# This is text format of the instructions shown in the below Youtube video | |
# http://www.youtube.com/watch?v=ajs9rO5upZA | |
# First get a ubuntu Live CD or USB Stick and boot from it | |
# Check all the Hard disk and Partitions using following command | |
sudo fdisk -l # Now take a note of the partition, on which linux is installed which may be like: /dev/sda1 | |
# 3. Mount the partition where you need to install GRUB 2 (Hard disk partition) | |
# Now the file system appears in nautaulis and command line is not file system of Hard disk |
/* | |
The MIT License (MIT) | |
Copyright (c) 2014 Anthony Lieuallen | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
// if Navigation Timing is not supported, fallback to Date.naw() called on start (sufficient in many cases) | |
// Date.now is also polyfilled | |
(function(p){ | |
if(!Date.now) | |
Date.now = function(){return +new Date}; | |
if (!p.now){ | |
var start = (p.timing && p.timing.navigationStart) || Date.now(); | |
p.now = function now(){ | |
return Date.now() - start; |
var https = require('https'), | |
user = process.argv[2], | |
opts = parseOpts(process.argv.slice(3)) | |
request('/users/' + user, function (res) { | |
if (!res.public_repos) { | |
console.log(res.message) | |
return | |
} | |
var pages = Math.ceil(res.public_repos / 100), |
/** | |
* Register ajax transports for blob send/recieve and array buffer send/receive via XMLHttpRequest Level 2 | |
* within the comfortable framework of the jquery ajax request, with full support for promises. | |
* | |
* Notice the +* in the dataType string? The + indicates we want this transport to be prepended to the list | |
* of potential transports (so it gets first dibs if the request passes the conditions within to provide the | |
* ajax transport, preventing the standard transport from hogging the request), and the * indicates that | |
* potentially any request with any dataType might want to use the transports provided herein. | |
* | |
* Remember to specify 'processData:false' in the ajax options when attempting to send a blob or arraybuffer - |
<?php | |
/** | |
* @param $baseUrl - non protected part of the URL including hostname, e.g. http://example.com | |
* @param $path - protected path to the file, e.g. /downloads/myfile.zip | |
* @param $secret - the shared secret with the nginx server. Keep this info secure!!! | |
* @param $ttl - the number of seconds until this link expires | |
* @param $userIp - ip of the user allowed to download | |
* @return string | |
*/ |
/* | |
* GM_download polyfill | |
* | |
* @description A polyfill to make your userscript supports GM_download | |
* @author ccloli | |
* @version 1.0 | |
*/ | |
// to use this polyfill, you must add "@grant GM_xmlhttpRequest" at userscript metadata block |
/** | |
* SI BINARY | |
* 0: 0 B 0 B | |
* 27: 27 B 27 B | |
* 999: 999 B 999 B | |
* 1000: 1.0 kB 1000 B | |
* 1023: 1.0 kB 1023 B | |
* 1024: 1.0 kB 1.0 KiB | |
* 1728: 1.7 kB 1.7 KiB | |
* 110592: 110.6 kB 108.0 KiB |