Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
for i in $( cat friends );do
proxychains curl -u milad:mypassword http://identi.ca/api/blocks/create.xml -d user_id=$i
done
#!/bin/bash
for i in $( cat following );do
proxychains curl -u milad:password http://identi.ca/api/friendships/destroy.xml -d user_id=$i
done
(mpo=document.getElementById("myplusone"))?mpo.style.display=mpo.style.display=="block"?"none":"block":(bgs="background:rgb(174,188,191);background:-moz-linear-gradient(top,rgba(174,188,191,1)0%,rgba(110,119,116,1)50%,rgba(10,14,10,1)51%,rgba(10,8,9,1)100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,rgba(174,188,191,1)),color-stop(50%,rgba(110,119,116,1)),color-stop(51%,rgba(10,14,10,1)),color-stop(100%,rgba(10,8,9,1)));background:-webkit-linear-gradient(top,rgba(174,188,191,1)0%,rgba(110,119,116,1)50%,rgba(10,14,10,1)51%,rgba(10,8,9,1)100%);background:-o-linear-gradient(top,rgba(174,188,191,1)0%,rgba(110,119,116,1)50%,rgba(10,14,10,1)51%,rgba(10,8,9,1)100%);background:-ms-linear-gradient(top,rgba(174,188,191,1)0%,rgba(110,119,116,1)50%,rgba(10,14,10,1)51%,rgba(10,8,9,1)100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#aebcbf',endColorstr='#0a0809',GradientType=0);background:linear-gradient(top,rgba(174,188,191,1)0%,rgba(110,119,116,1)50%,rgba(10,14,10,1)51%,rg
@khajavi
khajavi / builder.cpp
Created February 10, 2013 11:27 — forked from pazdera/builder.cpp
/*
* Example of `builder' design pattern.
* Copyright (C) 2011 Radek Pazdera
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@khajavi
khajavi / builder.cpp
Created February 10, 2013 11:28 — forked from pazdera/builder.cpp
/*
* Example of `builder' design pattern.
* Copyright (C) 2011 Radek Pazdera
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@khajavi
khajavi / adapter.cpp
Created February 26, 2013 06:35 — forked from pazdera/adapter.cpp
/*
* Example of `adapter' design pattern
* Copyright (C) 2011 Radek Pazdera
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
@khajavi
khajavi / Spelling.java
Created March 16, 2013 11:55
Spell Corrector
import java.io.*;
import java.util.*;
import java.util.regex.*;
class Spelling {
// برای اینکه سرعت الگوریتم تصحیح‌کنندهٔ املایی بالا رود نیاز به جست‌وجو با سرعت بالا در یک بانک اطلاعاتی وسیعی داریم. به همین دلیل از جدول هش استفاده می‌کنیم:
private final HashMap<String, Integer> nWords = new HashMap<String, Integer>();
// کلاس Spelling یک ساختمان دادهٔ جدید برای جمع‌آوری لغات آماده می‌کند.
@khajavi
khajavi / .vimrc
Last active December 15, 2015 13:49
set t_Co=256
colo moria
set tabstop=2
set shiftwidth=2
set completeopt=menu
filetype plugin on
syntax on
set number
nnoremap <F2> :set nonumber!<CR>:set foldcolumn=0<CR>
@khajavi
khajavi / append.c
Last active December 15, 2015 19:19
c-string append (concat)
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
const char* append( const char* str1, const char* str2 ) {
const size_t str1_length = strlen( str1 );
const size_t str2_length = strlen( str2 );
const size_t total_length = str1_length + str2_length;
char *const str_buff =(char*) malloc( total_length + 1 );
@khajavi
khajavi / startWith.c
Created April 4, 2013 13:02
startWith( prefix, String )
bool startWith( const char* prefix, const char* string ) {
return strncmp( prefix, string, strlen( prefix ) ) == 0;
}