Skip to content

Instantly share code, notes, and snippets.

@nrdobie
nrdobie / install-sublime-text-3.sh
Created October 28, 2013 22:12
Installs Sublime Text 3 on Linux. Make sure to mark as executable.
#!/bin/sh
SHORTCUT="[Desktop Entry]
Version=1.0
Type=Application
Name=Sublime Text 3
GenericName=Text Editor
Comment=Sophisticated text editor for code, markup and prose
Exec=/usr/local/sublime-text-3/sublime_text %F
Terminal=false
MimeType=text/plain;
@christiangenco
christiangenco / download website assets
Created January 20, 2014 23:23
Use wget to download a website's assets, including images, css, javascript, and html. From http://www.linuxjournal.com/content/downloading-entire-web-site-wget
$ wget \
--recursive \
--no-clobber \
--page-requisites \
--html-extension \
--convert-links \
--domains website.org \
--no-parent \
www.website.org/tutorials/html/
@ssigwart
ssigwart / buildMultipartFormData.php
Created January 24, 2015 16:21
Build multipart/form-data in PHP
/**
* Build multipart/form-data
*
* @param array @$data Data
* @param array @$files 1-D array of files where key is field name and value if file contents
* @param string &$contentType Retun variable for content type
*
* @return string Encoded data
*/
function buildMultipartFormData(array &$data, array &$files, &$contentType)
@lukehedger
lukehedger / ffmpeg-compress-mp4
Last active June 23, 2026 17:07
Compress mp4 using FFMPEG
$ ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 output.mp4
@jimdi
jimdi / rep-user-tg.reg
Last active April 1, 2026 05:39
Per-user Telegram Link mapping
Windows Registry Editor Version 5.00
; Per-user Telegram Link mapping
[HKEY_CURRENT_USER\Software\Classes\tg]
@="URL:Telegram Link"
"URL Protocol"="D:\\Prog\\Telegram Desktop\\Telegram.exe"
[HKEY_CURRENT_USER\Software\Classes\tg\DefaultIcon]
@="D:\\Prog\\Telegram Desktop\\Telegram.exe,1"
@mehdichaouch
mehdichaouch / memory_usage.php
Last active January 14, 2025 14:17
PHP Snippet to get human readable memory usage
<?php
function convert($size)
{
$unit=array('b','kb','mb','gb','tb','pb');
return @round($size/pow(1024,($i=floor(log($size,1024)))),2).' '.$unit[$i];
}
convert(memory_get_usage());
@gromdron
gromdron / bx_login.php
Last active October 9, 2025 13:14 — forked from belukov/bx_login.php
bitrix авторизация под админом без проверки агентов, статистики и для битрикс24
<?php
define('EXTRANET_NO_REDIRECT', true);
define('LDAP_NO_PORT_REDIRECTION', true);
define("NO_KEEP_STATISTIC", true);
define("NOT_CHECK_PERMISSIONS", true);
define("SM_SAFE_MODE", true);
define("NO_AGENT_CHECK", true);
define("NO_AGENT_STATISTIC", true);
define("STOP_STATISTICS", true);
include($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");
[
{ "keys": ["e", "u"], "command": "exit_insert_mode",
"context":
[
{ "key": "setting.command_mode", "operand": false },
{ "key": "setting.is_widget", "operand": false }
]
},
{ "keys": ["c"], "command": "enter_insert_mode",
@iba-cmsteam
iba-cmsteam / curdate.modx
Created February 20, 2017 08:43
ModX. current date without snippet
[[!+nowdate:default=`now`:strtotime:date=`%Y`]]
@joseluisq
joseluisq / README.md
Last active March 4, 2025 07:27
Install PHP 7 Xdebug in Arch Linux

Install PHP 7 Xdebug in Arch Linux

"Normally", these instructions should be also valid (in similar way) for other Linux distros.

1.- Install Xdebug using pacman:

sudo pacman -Sy xdebug