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
# Append current git branch in prompt | |
parse_git_branch() { | |
if ! git rev-parse --git-dir > /dev/null 2>&1; then | |
return 0 | |
fi | |
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 | |
/* | |
1. Create a function that combines the two arrays. | |
Example: | |
[a, b, c], [1, 2, 3] => [a, 1, b, 2, c, 3] | |
*/ | |
function combiner(array $a = [], array $b = []) { | |
$a_len = count($a); | |
$b_len = count($b); | |
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
SELECT u.login, GROUP_CONCAT(DISTINCT p.nm ORDER BY p.nm ASC) AS projects FROM users AS u | |
LEFT JOIN user_project_rel AS upr ON u.id = upr.user_id | |
LEFT JOIN projects AS p ON p.id = upr.project_id | |
GROUP BY u.login; |
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 | |
$arr = [ | |
"hello world world", | |
"hello world world world", | |
"hello world world world world", | |
"hello hello world", | |
"hello hello hello hello world" | |
]; | |
foreach ($arr as $str) { |
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 | |
$start = 2; | |
$end = 200; | |
$index = 1; | |
$sum = 0; | |
for($i = $start; $i <= $end; $i++) | |
{ | |
for($j = 2; $j < $i; $j++) | |
{ |
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 window.Gallery | |
speed: 200 | |
move_speed: 400 | |
preload: true | |
current_page: 0 | |
reversed: false | |
constructor: (element) -> | |
@element = $(element) |