Skip to content

Instantly share code, notes, and snippets.

😄
Happy

Ali Bahraminezhad al1b

😄
Happy
Block or report user

Report or block al1b

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
@al1b
al1b / bing-wall.py
Created Jul 14, 2016
A Python script to download today picture of Bing.com and set it as Windows Desktop wallpaper.
View bing-wall.py
import re, os, tempfile
import urllib.request
from urllib.parse import urlparse
def getBing():
url = 'http://bing.com/'
response = urllib.request.urlopen(url)
data = response.read()
View CavityMap.cs
/*
Author: Ali Bahraminezhad
Description: You are given a square map of size . Each cell of the map has a value denoting its depth. We will call a cell
of the map a cavity if and only if this cell is not on the border of the map and each cell adjacent to it has strictly smaller depth.
Two cells are adjacent if they have a common side (edge).
https://www.hackerrank.com/challenges/cavity-map
*/
View library-fine.cs
/*
Author: Ali Bahraminezhad
Your local library needs your help! Given the expected and actual return dates for a library book, create a program that calculates the fine (if any).
https://www.hackerrank.com/challenges/library-fine
*/
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@al1b
al1b / linkdin-tahoma.js
Created Nov 13, 2016
Linkedin Tahoma Font - Grease Monkey Script
View linkdin-tahoma.js
// ==UserScript==
// @name Linkedn
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Automatically change font to Tahoma for rtl contents in LinkendIn.
// @author Ali Bahraminezhad - https://github.com/Dev-P
// @match https://*.linkedin.com/*
// @grant none
// ==/UserScript==
/* jshint -W097 */
@al1b
al1b / blocking-page.js
Last active Aug 17, 2017
Replace Simple Blocking Page
View blocking-page.js
// ==UserScript==
// @name Simple Blocking Page
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Replace payvandha.ir with a simpler page.
// @author You
// @grant none
// @include *
// ==/UserScript==
@al1b
al1b / MVA.py
Created Jun 17, 2016
Python script to extract video urls and subtitles from Microsoft Virtual Academy.
View MVA.py
__author__ = "Ali Bahraminezhad - antipattern.ir"
__license__ = "GPL"
__version__ = "1.0.0"
__maintainer__ = "Ali Bahraminezhad"
import re
import os
import tempfile
import json
@al1b
al1b / compiler-settings.cs
Created May 29, 2019
RoslynCodeDomProvider CSharpCodeProvider
View compiler-settings.cs
/// <summary>
/// Creates an instance using the given ICompilerSettings
/// </summary>
/// <param name="compilerSettings"></param>
public CSharpCodeProvider(ICompilerSettings compilerSettings = null) {
_compilerSettings = compilerSettings == null ? CompilationSettingsHelper.CSC2 : compilerSettings;
}
@al1b
al1b / compiler-settings.cs
Created May 29, 2019
Simple implemention of ICompilerSettings
View compiler-settings.cs
class CompilerSettings : ICompilerSettings
{
private readonly CompilerLanguage _compilerLang;
private readonly string _rootDirectory = new Uri(Assembly.GetCallingAssembly().CodeBase).LocalPath;
private string _compilerPath => _compilerLang == CompilerLanguage.CSharp
? @"roslyn\csc.exe"
: @"roslyn\vbc.exe";
public CompilerSettings(CompilerLanguage compiler = CompilerLanguage.CSharp)
{
_compilerLang = compiler;
You can’t perform that action at this time.