This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @include http://www.tumblr.com/*/new/* | |
// @include http://www.tumblr.com/new/* | |
// @include http://www.tumblr.com/edit/* | |
// ==/UserScript== | |
(function(){ | |
var ednoteel = $A($$('div.editor_note')); | |
var ismkdown = ednoteel.size() > 0 && ednoteel[0].text == "markdown"; //detect whether markdown mode is enabled | |
if (ismkdown){ | |
$$('form div + textarea')[0].style.fontFamily = "monospace"; //set monospace font family for textarea |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
^(?:cache|log)/ | |
^data/sql/.* | |
config/databases.yml | |
^lib/(model|form|filter)/doctrine/(.+?Plugin/)?base/.+?\.class\.php$ | |
^web/.+?Plugin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Post extends BasePost | |
{ | |
public function getAddedCredentialsNames(sfGuardSecurityUser $user) | |
{ | |
if ($this->get('owner_id') == $user->getProfile()->getId()) | |
{ | |
return 'post_edit'; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT t1.id, count(t2.id) from table1 t1 inner join table2 t2 on t2.category=t1.id group by t1.id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
# [ -z "$PS1" ] && return | |
if [[ -n "$PS1" ]]; then ##ну вот же оно! это нужно было раскомментить | |
# don't put duplicate lines in the history. See bash(1) for more options | |
# ... or force ignoredups and ignorespace |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sfGuardUser: | |
sfGuardUser_1: | |
first_name: null | |
last_name: null | |
email_address: test@localhost | |
username: admin | |
password: "password" #ну да, пароль потом шифруется, и что? | |
is_active: true | |
is_super_admin: true | |
last_login: '2011-04-13 16:48:39' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[2011-05-22 16:06:02] gunzip < /home/andy/.rvm/archives/rubygems-1.8.3.tgz | tar xf - -C /home/andy/.rvm/src | |
gzip: stdin: not in gzip format | |
tar: This does not look like a tar archive | |
tar: Exiting with failure status due to previous errors | |
[2011-05-22 16:07:01] gunzip < /home/andy/.rvm/archives/rubygems-1.8.tgz | tar xf - -C /home/andy/.rvm/src | |
gzip: stdin: not in gzip format | |
tar: This does not look like a tar archive | |
tar: Exiting with failure status due to previous errors |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// way to shoot your own leg | |
var q = db.some_collection.find({something: "awful"}); | |
q.forEach(function(o) {print(o.foo)}) //this will print something affects map() too | |
q.forEach(function(o) {print(o.bar)}) //will print nothing | |
/* because */ q.hasNext() // == false after first call | |
//right way is to reassign q or don't use it at all | |
db.some_collection.find({something: "awful"}).forEach(function(o) {print(o.foo)}) //will work | |
db.some_collection.find({something: "awful"}).forEach(function(o) {print(o.bar)}) //will print stuff too |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% sudo iptables -S > /tmp/before.ipt | |
% sudo ufw allow OpenSSH | |
Rule added | |
Rule added (v6) | |
% sudo iptables -S > /tmp/after.ipt | |
% diff -u2 /tmp/before.ipt /tmp/after.ipt | |
--- /tmp/before.ipt 2012-01-16 22:01:24.675367658 +0300 | |
+++ /tmp/after.ipt 2012-01-16 22:03:40.908253084 +0300 | |
@@ -107,4 +107,5 @@ | |
-A ufw-user-input -p tcp -m multiport --dports 56882:56889 -j ACCEPT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
typedef struct SStudent{ | |
int id; | |
char *name; | |
float percentage; | |
} TStudent; | |
int main() { |