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
#!/usr/local/bin/python | |
import os | |
import sys | |
import errno | |
from datetime import datetime | |
from time import time | |
rootdir = os.getcwd() |
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
[ | |
{"hash": "37db6a0332040106ebce1a1854ecf5cd", "range_control": 1, "state": 1, "time": "00:00", "type": "light", "day": 1},{"hash": "e21d57a8ca98f301a63b0423f5cc7338", "range_control": 1, "state": 0, "time": "00:00", "type": "fans", "day": 1},{"hash": "63abc299cccd5ec9900a0457bb859152", "range_control": 30, "state": 1, "time": "00:00", "type": "aircond", "day": 1},{"hash": "493a4b2b18488ce51e24222fb22e4398", "range_control": 0, "state": 1, "time": "00:00", "type": "plug", "day": 1},{"hash": "37db6a0332040106ebce1a1854ecf5cd", "range_control": 3, "state": 1, "time": "00:39", "type": "light", "day": 1},{"hash": "e21d57a8ca98f301a63b0423f5cc7338", "range_control": 3, "state": 0, "time": "00:39", "type": "fans", "day": 1},{"hash": "63abc299cccd5ec9900a0457bb859152", "range_control": 25, "state": 0, "time": "00:39", "type": "aircond", "day": 1},{"hash": "493a4b2b18488ce51e24222fb22e4398", "range_control": 0, "state": 0, "time": "00:39", "type": "plug", "day": 1},{"hash": "37db6a0332040106ebce1a1854ecf5cd", "rang |
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\Console\Commands; | |
use Illuminate\Console\GeneratorCommand; | |
use Illuminate\Support\Str; | |
use InvalidArgumentException; | |
use Symfony\Component\Console\Input\InputArgument; | |
use Symfony\Component\Console\Input\InputOption; |
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
Class User extends Model { | |
public function applications() | |
{ | |
return $this->belongsToMany(Application::class,'user_applications')->withPivot('application_status_id'); | |
} | |
} | |
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 | |
/** | |
* example of meta programming using php | |
*/ | |
class Argument { | |
public $attributes = []; | |
public function __construct($attributes = []) |
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
// Node.js CheatSheet. | |
// Download the Node.js source code or a pre-built installer for your platform, and start developing today. | |
// Download: http://nodejs.org/download/ | |
// More: http://nodejs.org/api/all.html | |
// 0. Synopsis. | |
// http://nodejs.org/api/synopsis.html |
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 | |
interface HasherContract | |
{ | |
public function encrypt($string); | |
} | |
class Aes implements HasherContract{ | |
public function encrypt($string) |
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
from fabric.api import * | |
''' | |
fabric python laravel vps setup | |
pip install fabric | |
1. Save as fabfile.py | |
2. fab deploy | |
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 | |
/* | |
This is to solve pagination dividing for each workers for asyncronous feature in API request to third party endpoint with | |
large response data. | |
*/ | |
function get_min_max_page($totalPages = 0,$workers = 1) { | |
$maximumPage = $totalPages / $workers; |
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
[mysqld] | |
datadir=/var/lib/mysql | |
socket=/var/lib/mysql/mysql.sock | |
user=mysql | |
# Disabling symbolic-links is recommended to prevent assorted security risks | |
symbolic-links=0 | |
# The maximum amount of concurrent sessions the MySQL server will | |
# allow. One of these connections will be reserved for a user with | |
# SUPER privileges to allow the administrator to login even if the |
OlderNewer