Skip to content

Instantly share code, notes, and snippets.

Mohammad Elmi melmi

Block or report user

Report or block melmi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View append.php
<?php
$query_string = $_SERVER['QUERY_STRING'];
$fp = fopen("dllist.txt", "a");
flock($fp, LOCK_EX);
fputs($fp, $query_string);
fputs($fp, "\n");
flock($fp, LOCK_UN);
fclose($fp);
print("Saved.");
?>
View dl.sh
#!/bin/bash
cd ~/Downloads/auto/
echo "============================" >> log.txt
echo "[$(date)] script launched" >> log.txt
echo "[$(date)] renewing dllist.txt" >> log.txt
rm dllist.txt
wget --user=folani --password=passwordesh melmi.ir/downloads/dllist.txt
@melmi
melmi / makefile
Last active Sep 23, 2016
A general purpose makefile for c++ projects
View makefile
PROJNAME = your_project_name
SRCDIR = src
OBJDIR = bin
DEPDIR = bin
BINDIR = bin
CXX = g++
CXXFLAGS = -O3 -std=c++14
LDFLAGS =
View email-reciept.php
<?php
$fp = fopen("log.txt", "a");
flock($fp, LOCK_EX);
$timezone = 'Asia/Tehran';
date_default_timezone_set($timezone);
$date = date('m/d/Y h:i:s a', time());
fputs($fp, "TIME: $date\n");
$timezone = date_default_timezone_get();
fputs($fp, "TIMEZONE: $timezone\n");
View add-repo.sh
#!/usr/bin/env bash
basedir="/git/"
access_group="developers"
show_err() {
echo
echo "add-repo: an error occured."
echo
echo "Usage:"
@melmi
melmi / Default (Linux).sublime-keymap
Created May 19, 2013
An easy way to build and run inside SublimeText2. This method uses makefile with appropriate rules. A simple makefile is also provided just as an example. To use this copy `Unleash Makefile.sublime-build` into `Packages\User` directory of your SublimeText config directory. Keybindings also can be added to User keybindings.
View Default (Linux).sublime-keymap
[
{"keys": ["ctrl+shift+c"], "command": "exec", "args": {"kill": true} } ,
{"keys": ["ctrl+shift+l"], "command": "build", "args": {"variant": "Clean"} }
]
You can’t perform that action at this time.