Skip to content

Instantly share code, notes, and snippets.

@sameei
sameei / ForkJoinWorkerTerminationControl.java
Last active August 29, 2015 14:01
I ask a question in stackoverflow( http://stackoverflow.com/questions/23557550/control-over-termination-threads-in-java-executor-framework ) and get its answer. by attention to the answer i write this code
// in the name of ALLAH
import java.util.concurrent.*;
public class ForkJoinCustomization {
public static void main(String[] args) {
final SimpleValue val = new SimpleValue();
@sameei
sameei / helpers.php
Last active August 29, 2015 14:01
helpers in php-lang
<?php # in the name of ALLAH
/*
* Ord and Chr function for convert num to uni-cahr and ...
* reference: http://stackoverflow.com/questions/9361303/can-i-get-the-unicode-value-of-a-character-or-vise-versa-with-php
*/
function _uniord($c) {
if (ord($c{0}) >=0 && ord($c{0}) <= 127)
return ord($c{0});
if (ord($c{0}) >= 192 && ord($c{0}) <= 223)
; in the name of ALLAH
; at /etc/systemd/system/stunnel.service
; or at /usr/lib/systemd/system/stunnel.service
; or at /usr/lib/systemd/system/tunnelproxy.service
; change "{{ config.conf }}" by your config path.
[Unit]
Description=SSL tunnel for network daemons
After=syslog.target
@sameei
sameei / gitconfig
Last active August 29, 2015 14:04
~/.gitconfig
[user]
name = {{ forename surname }}
email = {{ email }}
[core]
editor = vim
# excludesfile = default -> $XDG_CONFIG_HOME/git/ignore or $HOME/.config/git/ignore
# # ignores
# # # .idea/
# # # .project
@sameei
sameei / YetAnotherSimpleHttpServer.py
Created November 5, 2014 17:55
My needed improvment for python's SimpleHTTPServer module.
#!/usr/bin/python2.7
import sys
from SimpleHTTPServer import SimpleHTTPRequestHandler
import BaseHTTPServer
class MyHTTPRequestHandler(SimpleHTTPRequestHandler):
def end_headers(self):
self.send_my_headers()
@sameei
sameei / .hgrc
Last active August 29, 2015 14:15
hgrc
[ui]
username = My Name <my.email@somedomain>
verbose = false
ignore = ~/.hgignore
[extensions]
color =
graphlog =
[alias]
@sameei
sameei / .hgignore
Created February 12, 2015 07:19
hgignore
syntax: glob
*.kate-swp
*.swp
bin
target
.project
.settings
.cache
.classpath
logs/application.log
case class InvalidDataException[T](
val message:String,
val value:T,
val cause:Option[Throwable] = None )
extends Exception ( message, cause getOrElse null )
// in the name of ALLAH
case class PopulationStat(
val country: String,
val symbol: String,
val year: Int,
val amount: Long
)
class WritablePopulationStat extends WritableComparable[WritablePopulationStat] {

Keybase proof

I hereby claim:

  • I am reza-samei on github.
  • I am samei (https://keybase.io/samei) on keybase.
  • I have a public key whose fingerprint is B344 63B4 9B0C 490C 0D08 0ABA BA94 ABE7 2235 A65D

To claim this, I am signing this object: