Skip to content

Instantly share code, notes, and snippets.

@xpertspk
xpertspk / gist:5a02b8630da6033cc762
Created June 11, 2015 12:50
Sublime Text must have packages
1. Emmet
2. Sass
3. Color Highlighter
4. HTML-CSS-JS Prettify
5. BracketHighlighter
6. SideBarEnhancements
7. SublimeLinter
7.1 SublimeLinter-html-tidy
7.2 SublimeLinter-csslint
7.3 SublimeLinter-jshint

MacOS

Build 3059

MD5: 59bab8f71f8c096cd3f72cd73851515d

Rename it to: Sublime Text

Make it executable with: chmod u+x Sublime\ Text

<?php
error_reporting(0);
/**
* Get the width and height of the destination image
* from the POST variables and convert them into
* integer values
*/
$w = (int)$_POST['width'];
$h = (int)$_POST['height'];
@xpertspk
xpertspk / gist:74316c33bc9d5670f3bb
Created August 23, 2014 10:02
PHP: generatePassword function
function generatePassword ($length = 10)
{
$password = "";
$possible = "0123456789bcdfghjkmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ";
$i = 0;
while ($i < $length) {
$char = substr($possible, mt_rand(0, strlen($possible)-1), 1);
if (!strstr($password, $char)) {
$password .= $char;
$i++;
@xpertspk
xpertspk / gist:f1a82d326e49eff92bbd
Created June 16, 2014 06:07
My SublimeText user settings
{
"auto_complete": true,
"auto_complete_commit_on_tab": true,
"auto_complete_with_fields": true,
"bold_folder_labels": false,
"color_scheme": "Packages/Github Color Theme/GitHub.tmTheme",
"default_encoding": "UTF-8",
"detect_indentation": true,
"folder_exclude_patterns":
[

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after

Sublime Text 3 Setup

Install Package Control

Install Package Control for easy package management.

  1. Open the console with Ctrl+`
  2. Paste in the following: