Skip to content

Instantly share code, notes, and snippets.

View shadz3rg's full-sized avatar
🏠
Working from home

Oleg Aleksandrovich shadz3rg

🏠
Working from home
  • Russia, Volgograd
View GitHub Profile
@TatriX
TatriX / README.md
Last active April 3, 2024 21:04
Rust Thread

Rust — невероятно быстрый язык для системного программирования без segfault'ов и с гарантиями потокобезопасности.

ИТТ мы можем объяснить базовые и продвинутые концепции языка, и программирования в целом, поможем вкатывающимся, подскажем что выбрать для веба, игр или, прости Абу, блокчейна.

https://www.rust-lang.org

Новости

@laracasts
laracasts / gist:f4a304232c1be6dbb4f8
Last active February 16, 2023 20:19
Laracasts PHPStorm theme.
@alexandrevicenzi
alexandrevicenzi / index.html
Last active September 22, 2020 21:01
Bootstrap CSS Animate Loading Icon Button
<!-- Code snippet -->
<div class="form-group">
<div class="col-md-12 text-center">
<span class="glyphicon glyphicon-refresh glyphicon-refresh-animate"></span>
</div>
</div>
@SimonSimCity
SimonSimCity / pagination.html.twig
Last active September 30, 2023 17:29
A gist for pagination in Twig, based on the total number of pages, the current page and some URL-settings.
{#
Source: http://dev.dbl-a.com/symfony-2-0/symfony2-and-twig-pagination/
Updated by: Simon Schick <simonsimcity@gmail.com>
Parameters:
* currentFilters (array) : associative array that contains the current route-arguments
* currentPage (int) : the current page you are in
* paginationPath (string) : the route name to use for links
* showAlwaysFirstAndLast (bool) : Always show first and last link (just disabled)
* lastPage (int) : represents the total number of existing pages
@mtttmpl
mtttmpl / relative-time.php
Created September 29, 2012 16:51
Get Relative Time in PHP (e.g. '1 hour ago', 'yesterday', 'tomorrow', 'in 2 weeks')
<?php
function time2str($ts) {
if(!ctype_digit($ts)) {
$ts = strtotime($ts);
}
$diff = time() - $ts;
if($diff == 0) {
return 'now';
} elseif($diff > 0) {
$day_diff = floor($diff / 86400);
@gagarine
gagarine / mysql_multiple_import.bash
Created February 24, 2011 22:34
Import multiple sql file in a mysql database
#!/bin/bash
db=$1
user=$2
passwd=$3
if [ "$db" = "" ]; then
echo "Usage: $0 db_name user password"
exit 1
fi
clear
for sql_file in *.sql; do