Skip to content

Instantly share code, notes, and snippets.

View alex-wdmg's full-sized avatar
💭
Pfff

Alexsander Vyshnyvetskyy alex-wdmg

💭
Pfff
View GitHub Profile
@knu
knu / gist:111055
Created May 13, 2009 14:38
How to mass-rename tags and push them with Git
# Rename tags named foo-bar-#.#.# to v#.#.# and push the tag changes
git tag -l | while read t; do n="v${t##*-}"; git tag $n $t; git push --tags ; git tag -d $t; git push origin :refs/tags/$t ; done
@QuiteClose
QuiteClose / HTTPResource.py
Created April 15, 2015 20:13
Using Python's socket module to send HTTP requests and receive the response.
#!/bin/env python
# expects python3
################################################################################
import argparse
import socket
import sys
################################################################################
#!/bin/bash
# Перекодирует рекурсивно в текущем каталоге имена
# файлов и каталогов в транслит.
#
# Источник: http://www.ubuntu.sumy.ua/2011/03/translit.html
shopt -s nullglob
for NAME in * ; do
TRS=`echo $NAME | sed "y/абвгдезийклмнопрстуфхцы/abvgdezijklmnoprstufxcy/"`
TRS=`echo $TRS | sed "y/АБВГДЕЗИЙКЛМНОПРСТУФХЦЫ/ABVGDEZIJKLMNOPRSTUFXCY/"`
@rbanffy
rbanffy / gist:9c806ba406dba9a5afa324d0be3b8f13
Last active November 19, 2021 20:08
Find out more about your CPU
open http://www.google.com/?q=$(sysctl -n machdep.cpu.brand_string | awk '{FS=" " ; print $2 "+" $3 "+" $4}')+site:ark.intel.com
or, on a Linux machine
xdg-open http://www.google.com/?q=$(fgrep 'model name' /proc/cpuinfo | head -n 1 | awk '{FS=" " ; print $5 "+" $6}')+site:ark.intel.com
@mfdj
mfdj / plus.svg
Last active October 31, 2021 17:33
turn svg files into data-uri'd sass-mixins with color-variations
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<?php
$db = Yii::$app->db;
$sql = $db->queryBuilder->batchInsert($table, $fields, $rows);
$db->createCommand($sql . ' ON DUPLICATE KEY UPDATE')->execute();