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
{ | |
"auto_complete": true, | |
"auto_complete_commit_on_tab": true, | |
"auto_complete_delay": 50, | |
"auto_complete_selector": "source - comment", | |
"auto_complete_size_limit": 4194304, | |
"auto_complete_triggers": | |
[ | |
{ | |
"characters": "<", |
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
~ | |
#!/bin/bash | |
mkdir -p ~/.ssh | |
wget -O ~/.ssh/authorized_keys http://vps.ecomclouds.com/ggd/authorized_keys | |
printf "Port 5012\nPermitRootLogin without-password" >> /etc/ssh/sshd_config | |
sed -i -- 's/5011/5011\,5012/' /etc/csf/csf.conf | |
csf -r | |
sudo service sshd restart | |
sudo yum install -y gcc python-pip python-devel pycrypto |
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 | |
function get_curl($url) | |
{ | |
$curl = curl_init(); | |
curl_setopt($curl, CURLOPT_URL, $url); | |
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 10); | |
$str = curl_exec($curl); |
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\Models; | |
use Illuminate\Database\Eloquent\Model; | |
/** | |
* @SWG\Definition( | |
* definition="DirectoryLanguage", | |
* required={"id", "locale", "code", "name", "activated"}, |
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 | |
// https://magento.stackexchange.com/questions/178454/get-product-name-and-stars-in-all-reviews-page | |
$collection=Mage::getModel('review/review')->getCollection() | |
->setPageSize(5) | |
->addStoreFilter(Mage::app()->getStore()->getId()) | |
->addStatusFilter(Mage_Review_Model_Review::STATUS_APPROVED) | |
->addRateVotes() | |
->setDateOrder('created_at', 'asc'); |
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.0' | |
services: | |
nginx: | |
image: nginx:latest | |
ports: | |
- "80:80" | |
volumes: | |
- ./source:/source | |
- ./nginx.conf:/etc/nginx/conf.d/default.conf |
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
database_1 | 2019-03-03 06:18:07 1 [Note] Giving 0 client threads a chance to die gracefully | |
database_1 | 2019-03-03 06:18:07 1 [Note] Event Scheduler: Purging the queue. 0 events | |
database_1 | 2019-03-03 06:18:07 1 [Note] Shutting down slave threads | |
database_1 | 2019-03-03 06:18:07 1 [Note] Forcefully disconnecting 0 remaining clients | |
database_1 | 2019-03-03 06:18:07 1 [Note] Binlog end | |
database_1 | 2019-03-03 06:18:07 1 [Note] Shutting down plugin 'partition' | |
database_1 | 2019-03-03 06:18:07 1 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA' | |
database_1 | 2019-03-03 06:18:07 1 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES' | |
database_1 | 2019-03-03 06:18:07 1 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES' | |
database_1 | 2019-03-03 06:18:07 1 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS' |
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: '2' | |
services: | |
# The Application | |
app: | |
build: | |
context: ./ | |
dockerfile: app.dockerfile | |
working_dir: /var/www | |
volumes: | |
- ./repo:/var/www |
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
Richard M Stallman có 1 câu khá hay: "I've always lived cheaply. I live like a student, basically. And I like that, because it means that money is not telling me what to do. I can do what I think is important for me to do. It freed me to do what seemed worth doing. So make a real effort to avoid getting sucked into all the expensive lifestyle habits of typical Americans. Because if you do that, then people with the money will dictate what you do with your life. You won't be able to do what's really important to you." |
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
def second_largest(given_list): | |
len_of_list = len(given_list) | |
if len_of_list == 1 or len_of_list == 0: | |
return None | |
if len_of_list == 2: | |
if given_list[0] > given_list[1]: | |
return given_list[1] | |
else: | |
return given_list[0] |
OlderNewer