Skip to content

Instantly share code, notes, and snippets.

View gist:645723adeb8f4d831a2eab434d04bd61
alias auru 'yaourt -Syua --noconfirm'
alias auru 'yaourt -Syua --noconfirm'
alias journalctl 'sudo journalctl'
alias mktar 'tar -zcvf'
alias pacman 'sudo pacman'
alias pacu 'sudo pacman -Syu --noconfirm'
alias se 'ls /usr/bin | grep'
alias systemctl 'sudo systemctl'
alias untar 'tar -zxvf'
@iCloud
iCloud / image_fenom.php
Created Mar 15, 2018 — forked from zhabinka/image_fenom.php
Fenom: - работа с объектом vendor, - массив шаблонов, - работа с изображением, - условие IF, - вывод MIGX - foreach
View image_fenom.php
//Условие IF
{$id == '1' ? '' : $url}
//Получение изображения через переменную с точкой ($_pls)
{$_pls["tv.img"] | phpthumbon : "w=300&h=200&zc=1"}
//Без префикса
{$img | phpthumbon : "w=300&h=200&zc=1"}
//Информация о прозводителе
{$_modx->makeUrl($_pls['vendor.resource'])}
@iCloud
iCloud / test.js
Last active Feb 3, 2016
Snippets for CodeWars
View test.js
// Arrays
Array.prototype.square = function () { return this.map(function(n) { return n*n; }); }
Array.prototype.cube = function () { return this.map(function(n) { return n*n*n; }); }
Array.prototype.average = function () { return this.sum() / this.length; }
Array.prototype.sum = function () { return this.reduce(function(a, b) { return a + b; }, 0); }
Array.prototype.even = function () { return this.filter(function(item) { return 0 == item % 2; }); }
Array.prototype.odd = function () { return this.filter(function(item) { return 0 != item % 2; }); }
Array.prototype.max = function () { return Math.max.apply(null, this); }
Array.prototype.min = function () { return Math.min.apply(null, this); }
//Arguments to array
View json.json
// http://172.16.2.68/Help/Api/GET-api-users-userId-groups-events_skip_take
{
"count": 1023,
"next": "https://api.example.org/accounts/?limit=100&offset=500", // не обязательно
"previous": "https://api.example.org/accounts/?limit=100&offset=300", // не обязательно
"results": [
{
"Id": 1,
"UserId": 2,
"UserName": "sample string 3",
View gist:a43d657895b925b73778
https://wiki.archlinux.org/index.php/Installation_guide
https://wiki.archlinux.org/index.php/General_recommendations
https://wiki.archlinux.org/index.php/Beginners%27_guide
https://wiki.archlinux.org/index.php/Pacman Pacman guide
https://wiki.archlinux.org/index.php/Sudo Sudo setup
https://www.archlinux.org/packages/ packages list.
https://aur.archlinux.org/packages/?O=0&K= AUR packages list
http://www.binarytides.com/gorgeous-looking-fonts-ubuntu-linux/ Fonts tip and tricks
DM LXDM(gtk2 themes) or nothing
@iCloud
iCloud / chrome_icon_fixer
Last active Sep 16, 2015 — forked from rashkur/chrome_icon_fixer
chrome icon fixer
View chrome_icon_fixer
import ConfigParser, mmap
config_file = "/usr/share/applications/google-chrome.desktop"
add_string_to_each_section = ["StartupWMClass", "Google-chrome-stable"]
option = add_string_to_each_section[0]
value = add_string_to_each_section[1]
class Fixer:
def check(self, cf, option, value):