//uncomment to prevent on startup
//removeDefaultFunction();
/** Prevents the default function such as the help pop-up **/
function removeDefaultFunction()
{
window.onhelp = function () { return false; }
}
/** use keydown event and trap only the F-key,
but not combinations with SHIFT/CTRL/ALT **/
$(window).bind('keydown', function(e) {
//This is the F1 key code, but NOT with SHIFT/CTRL/ALT
var keyCode = e.keyCode || e.which;
if((keyCode == 112 || e.key == 'F1') &&
!(event.altKey ||event.ctrlKey || event.shiftKey || event.metaKey))
{
// prevent code starts here:
removeDefaultFunction();
e.cancelable = true;
e.stopPropagation();
e.preventDefault();
e.returnValue = false;
// Open help window here instead of alert
alert('F1 Help key opened, ' + keyCode);
}
// Add other F-keys here:
else if((keyCode == 113 || e.key == 'F2') &&
!(event.altKey ||event.ctrlKey || event.shiftKey || event.metaKey))
{
// prevent code starts here:
removeDefaultFunction();
e.cancelable = true;
e.stopPropagation();
e.preventDefault();
e.returnValue = false;
// Do something else for F2
alert('F2 key opened, ' + keyCode);
}
});
-
Function Key Event
-
-
Update to 5.4
-
https://github.com/laravel/framework/issues/17377
https://www.sunzhongwei.com/php-71-php-70-composer-install
https://laracasts.com/discuss/channels/forge/digitalocean-password-reset
-
new site
-
https://laravel-news.com/laravel-5-4-key-too-long-error
https://www.jmkleger.com/post/ajax-crud-for-laravel-5-4
-
Intall new site
-
1. Create a site
2. Create a Database
3. Connect Git Repository
4. kevin416/yepos
5. Export the( setting_options , locale, yepos_function, ltm ) datatable from the huajun database
6. Import the these two table to the new databse
7. Setting User Function
8. Setting(Object_type)
php artisan db:seed --class=DatabaseSeeder
https://laracasts.com/series/server-management-with-forge/episodes/4
-
Laravel returning children of parents in same table
-
https://stackoverflow.com/questions/32122849/laravel-returning-children-of-parents-in-same-table
-
Count the time
-
echo getTimeDiff("10:30","11:10"); function getTimeDiff($dtime,$atime) { $nextDay = $dtime>$atime?1:0; $dep = explode(':',$dtime); $arr = explode(':',$atime); $diff = abs(mktime($dep[0],$dep[1],0,date('n'),date('j'),date('y'))-mktime($arr[0],$arr[1],0,date('n'),date('j')+$nextDay,date('y'))); $hours = floor($diff/(60*60)); $mins = floor(($diff-($hours*60*60))/(60)); $secs = floor(($diff-(($hours*60*60)+($mins*60)))); if(strlen($hours)<2){$hours="0".$hours;} if(strlen($mins)<2){$mins="0".$mins;} if(strlen($secs)<2){$secs="0".$secs;} return $hours.':'.$mins.':'.$secs; }
$monday = date( 'Y-m-d', strtotime( 'monday this week' ) ); $friday = date( 'Y-m-d', strtotime( 'friday this week' ) );
-
Install the laravel on the local eviroment
-
2. install the composer
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
install the php 7
curl -s https://php-osx.liip.ch/install.sh | bash -s 7.2
https://php-osx.liip.ch/
using laravel
vim ~/.bash_profile
enter 'i' to insert
export PATH=/usr/local/php5/bin:$PATHPATH="$PATH:$HOME/.composer/vendor/bin"
esc / enter
:wq /enter
-
Create a new function
-
1. create a new table
php artisan make:migration create_users_table
git add.
git commit -m "new table"
git push origin master
...
get the new file
git pull origin master
2. create the new view
3. create modelphp artisan make:model User
php artisan make:model Model/User
newmodel and type tab
4. create the controllerphp artisan make:controller PhotoController
newcontroller type tab
5. create the interface contracts
6. create the Eloquent
7. add the YeposServiceProvider
-
New Install Git
-
Generating a new SSH key
-
Open Terminal.
-
Paste the text below, substituting in your GitHub email address.
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
This creates a new ssh key, using the provided email as a label.
Generating public/private rsa key pair.
-
When you're prompted to "Enter a file in which to save the key," press Enter. This accepts the default file location.
Enter a file in which to save the key (/Users/you/.ssh/id_rsa): [Press enter]
- At the prompt, type a secure passphrase. For more information, see "Working with SSH key passphrases".
Enter passphrase (empty for no passphrase): [Type a passphrase] Enter same passphrase again: [Type passphrase again]
Git配置SSH,并Push到GitHub上的相关流程
首先,你可以试着输入
git
,看看系统有没有安装Git123$ gitThe program 'git' is currently not installed. You can install it by typing:sudo apt-get install git像上面的命令,有很多Linux会友好地告诉你Git没有安装,还会告诉你如何安装Git。
如果你碰巧用Debian或Ubuntu Linux,通过一条
sudo apt-get install git
就可以直接完成Git的安装,非常简单。如果是其他Linux版本,可以直接通过源码安装。先从Git官网下载源码,然后解压,依次输入:
./config
,make
,sudo make install
这几个命令安装就好了。安装完成后,还需要最后一步设置,在命令行输入:
12$ git config --global user.name "Your Name"$ git config --global user.email "email@example.com"然后我们需要配置SSH。
第1步:创建SSH Key。在用户主目录下,看看有没有.ssh目录,如果有,再看看这个目录下有没有
id_rsa
和id_rsa.pub
这两个文件,如果已经有了,可直接跳到下一步。如果没有,打开Shell(Windows下打开Git Bash),创建SSH Key:1$ ssh-keygen -t rsa -C "youremail@example.com"你需要把邮件地址换成你自己的邮件地址,然后一路回车,使用默认值即可,由于这个Key也不是用于军事目的,所以也无需设置密码。
如果一切顺利的话,可以在用户主目录里找到
.ssh
目录,里面有id_rsa
和id_rsa.pub
两个文件,这两个就是SSH Key的秘钥对,id_rsa
是私钥,不能泄露出去,id_rsa.pub
是公钥,可以放心地告诉任何人。第2步:登陆GitHub,打开“Account settings”,“SSH Keys”页面:
然后,点“Add SSH Key”,填上任意Title,在Key文本框里粘贴
id_rsa.pub
文件的内容:点“Add Key”,你就应该看到已经添加的Key:
为什么GitHub需要SSH Key呢?因为GitHub需要识别出你推送的提交确实是你推送的,而不是别人冒充的,而Git支持SSH协议,所以,GitHub只要知道了你的公钥,就可以确认只有你自己才能推送。
当然,GitHub允许你添加多个Key。假定你有若干电脑,你一会儿在公司提交,一会儿在家里提交,只要把每台电脑的Key都添加到GitHub,就可以在每台电脑上往GitHub推送了。
现在,我们根据GitHub的提示,在本地的
learngit
仓库下运行命令:1$ git remote add origin git@github.com:cqcre/cqc.git请千万注意,把上面的 cqcre 替换成你自己的GitHub账户名,否则,你在本地关联的就是我的远程库,关联没有问题,但是你以后推送是推不上去的,因为你的SSH Key公钥不在我的账户列表中。
添加后,远程库的名字就是
origin
,这是Git默认的叫法,也可以改成别的,但是origin
这个名字一看就知道是远程库。下一步,就可以把本地库的所有内容推送到远程库上:
1$ git push -u origin master好啦,静静等待git把你的代码Push上去吧~是不是很简单?
http://cuiqingcai.com/423.html
How to access my .ssh?
In the find file window, press Command-Shift-G. It'll ask you what folder to navigate to. Enter "~/.ssh" and press return.
-
Recent Post
Function Key Event
On Mar 03,2018 at 06:09 pm
Update to 5.4
On Mar 01,2018 at 08:12 pm
new site
On Mar 01,2018 at 01:05 pm
Intall new site
On Dec 31,2017 at 01:11 pm
Laravel returning children of parents in same table
On Dec 02,2017 at 07:38 pm
Count the time
On Nov 29,2017 at 09:52 pm
Install the laravel on the local eviroment
On Oct 07,2017 at 09:56 am
Create a new function
On Oct 05,2017 at 10:19 pm