Skip to content

Instantly share code, notes, and snippets.

sudo su
# enter sudo password

apt-get update
apt-get upgrade

if outdated

var Users = (function() {
Array.call(this)
this.push('first')
this.push('last')
this.forEach(function(item){
console.log(item)
})
})()
@visb
visb / gist:5dce3e91cb8dd62940e8
Last active August 29, 2015 14:12
Sublime text 3 plugins list
emmet
JsFormat
JavaScriptNext
JSHint
allautocomplete
DocBlockr
terminal
Markdown Preview
SideBarEnhancements
Hayaku
@visb
visb / gist:542d74950bf319d75f9a
Last active August 29, 2015 14:12
Sublime text 3 keys
[
{ "keys": ["f5"], "command": "refresh_folder_list" },
{ "keys": ["ctrl+shift+r"], "command": "reveal_in_side_bar" },
{ "keys": ["ctrl+tab"], "command": "next_view" },
{ "keys": ["ctrl+shift+tab"], "command": "prev_view" }
]
@visb
visb / sublime-config.json
Last active August 29, 2015 14:12
User configuration for sublime text 3
{
"update_check": false,
"tab_size": 2,
"translate_tabs_to_spaces": true,
"detect_indentation": false,
"trim_automatic_white_space": false,
// "indent_subsequent_lines": true,
"highlight_line": true,
// "match_brackets_angle": false,
"move_to_limit_on_up_down": true,
@visb
visb / install-phpunit.sh
Created December 14, 2014 06:58
install php unit on ubuntu
sudo apt-get install php-pear
sudo pear channel-update pear.php.net
sudo pear upgrade-all
sudo pear config-set auto_discover 1
sudo pear install pear.phpunit.de/PHPUnit
@visb
visb / node-chromeos
Created November 24, 2014 16:54
Install nodejs environment on chromebook
## downloads
* xz - https://www.archlinux.org/packages/core/x86_64/xz/
* node xz - https://www.archlinux.org/packages/community/x86_64/nodejs/
## allow to write
```
sudo /usr/share/vboot/bin/make_dev_ssd.sh --remove_rootfs_verification --partitions 4
# restart
shutdown -r 0
@visb
visb / gist:3751c475690cf07c1840
Created October 10, 2014 18:54
drag drop prototype
var target = document.getElementById('#myDraggableElement');
target.onmousedow = function(){
// start dragging
window.onmousemove = function(){
// move window
};
window.onmouseup = function(){
<?php
public function fn(array $options)
{
$this->parametrize($options, [['w', 'width'], ['h', 'height'], 'x', 'y']);
}
public function parametrize($options, $validOptions)
{
foreach ($options as $key => $value) {
@visb
visb / gist:3ff41a239becfb09c5c5
Created August 18, 2014 14:28
git tree alias
git config --global alias.tree 'log --graph --full-history --all --color --pretty=format:"%x1b[31m%h%x09%x1b[32m%d%x1b[0m%x20%s"'