Skip to content

Instantly share code, notes, and snippets.

@morsdyce
morsdyce / script.js
Created April 30, 2014 22:45
input[type="text"] toggle default value or empty #jquery
//// input[type="text"] toggle default value
$('input[type="text"]').blur(function() {
if (this.value == '') this.value = this.defaultValue;
});
$('input[type="text"]').focus(function() {
if (this.value == this.defaultValue) this.value = '';
});
@morsdyce
morsdyce / 01.configure
Created May 13, 2014 21:38 — forked from sanusart/01.configure
gist with files more than 1M of size #big
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /usr/bin/clang accepts -g... yes
checking for /usr/bin/clang option to accept ISO C89... none needed
checking whether we are using the GNU C++ compiler... yes
checking whether /usr/bin/clang++ accepts -g... yes
@morsdyce
morsdyce / .vimrc
Created June 10, 2014 16:20 — forked from JeffreyWay/.vimrc
set nocompatible " Disable vi-compatibility
set t_Co=256
colorscheme xoria256
set guifont=menlo\ for\ powerline:h16
set guioptions-=T " Removes top toolbar
set guioptions-=r " Removes right hand scroll bar
set go-=L " Removes left hand scroll bar
set linespace=15
@morsdyce
morsdyce / newFile1.txt
Created June 15, 2014 14:29 — forked from elentok/gist:3193556
Vim Hebrew edit mode
imap <f2> <c-o>:call ToggleHebrew()<cr>
map <f2> :call ToggleHebrew()<cr>
func! ToggleHebrew()
if &rl
set norl
set keymap=
else
set rl
set keymap=hebrew
@morsdyce
morsdyce / header.php
Created August 2, 2014 22:29
Sub pages menu on wordpress
<?php
if (isset($cat) && !empty($cat)) : ?>
<nav role="category-navigation">
<a href="#" id="dropdown-menu"><?php _e('Menu', 'dwframework'); ?></a>
<?php
@morsdyce
morsdyce / index.js
Created August 6, 2014 17:41
why people hate javascript #js
function profiles(callback) {
var profileList = [];
gapi.client.analytics.management.webproperties.list({
accountId: '~all'
}).execute(function (webProperties) {
for (var i = 0, limit = webProperties.items.length; i < limit; i++) {
var webProperty = webProperties.items[i];

Při prvním pokusu na mě ufw při pokusu o povolení vyplivl hlášku:

root@vps:~# ufw enable
Command may disrupt existing ssh connections. Proceed with operation (y|n)? y
ERROR: problem running ufw-init
modprobe: ERROR: ../libkmod/libkmod.c:556 kmod_search_moddep() could not open moddep file '/lib/modules/2.6.32-042stab093.4/modules.dep.bin'
modprobe: ERROR: ../libkmod/libkmod.c:556 kmod_search_moddep() could not open moddep file '/lib/modules/2.6.32-042stab093.4/modules.dep.bin'
modprobe: ERROR: ../libkmod/libkmod.c:556 kmod_search_moddep() could not open moddep file '/lib/modules/2.6.32-042stab093.4/modules.dep.bin'
iptables-restore: line 4 failed
iptables-restore: line 77 failed
@morsdyce
morsdyce / snippets.md
Last active August 29, 2015 14:17 — forked from sanusart/snippets.md
shell snippets and functions #shell #bash #sh

Inform with message

Use: message "Informing you about something"

message () {
    printf "\n";
    printf "\e[30;48;5;82m ${1} \e[0m "
    printf "\n";
}
@morsdyce
morsdyce / preserving-history.md
Last active August 29, 2015 14:19 — forked from dannyroberts/preserving-history.md
move and rename directories in git while preserving history #git

Did you know...

...that git lets you move and rename whole directories while preserving the git history of those files?

If you run

git read-tree --prefix=$NEW_PATH -u master:$OLD_PATH
rm -rf $OLD_PATH
# ...you probably want to change some imports...
git commit -m $MESSAGE
@morsdyce
morsdyce / forward.sh
Created May 7, 2015 11:10
forward port on OSX yosemite #osx #firewall #forwarding
echo "
rdr pass inet proto tcp from any to any port 25 -> 127.0.0.1 port 1025
" | sudo pfctl -ef -