I hereby claim:
- I am ahmadalli on github.
- I am ahmadalli (https://keybase.io/ahmadalli) on keybase.
- I have a public key whose fingerprint is 16EE A3FE 6D21 507A 12B1 DAC5 DA22 1805 3832 A5AC
To claim this, I am signing this object:
| $locations = @( | |
| "location1", | |
| "location2", | |
| "location3") | |
| #download | |
| $salt = Get-Date | |
| $salt = [math]::abs($salt.GetHashCode()) | |
| $url = "https://downloads.wordpress.org/release/fa_IR/latest.zip" | |
| $zipFilePath = "$PSScriptRoot\wordpress-$salt.zip" | |
| Import-Module BitsTransfer |
| #fill $ip, $user, $pass with right values | |
| $ip = '192.168.1.1' | |
| $user = 'user' | |
| $pass = 'pass' | |
| $pair = "$($user):$($pass)" | |
| $encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair)) | |
| $basicAuthValue = "Basic $encodedCreds" | |
| $Headers = @{ | |
| Authorization = $basicAuthValue | |
| } |
| using System; | |
| using System.Collections.Generic; | |
| using System.IO; | |
| using System.Linq; | |
| using System.Text.RegularExpressions; | |
| using System.Threading.Tasks; | |
| namespace SummaryTool | |
| { | |
| public static class SummaryTool |
| # How to reformat all C# files in a solution, in Visual Studio 2012. | |
| # | |
| # Open Tools->Library Package Manager->Package Manager Console, and run the | |
| # command below. At the end, all documents will be open in the IDE. (Low-RAM | |
| # machines will have problems with large solutions.) Changed files will be | |
| # modified in the IDE, and not saved to disk. You can SaveAll, then Close All | |
| # if you're ready. | |
| # | |
| # VS2012 removed the VB-like macro language that existed in previous version of | |
| # Visual Studio. However, the underlying DTE interface is still there, and you |
| protected override void OnModelCreating(DbModelBuilder modelBuilder) | |
| { | |
| var typesToRegister = Assembly.GetAssembly(typeof(Context)).GetTypes() | |
| .Where(type => type.Namespace != null) | |
| .Where(type => type.BaseType.IsGenericType && type.BaseType.GetGenericTypeDefinition() == typeof(EntityTypeConfiguration<>)).ToList(); | |
| foreach (var type in typesToRegister) | |
| { | |
| dynamic configurationInstance = Activator.CreateInstance(type); | |
| modelBuilder.Configurations.Add(configurationInstance); |
I hereby claim:
To claim this, I am signing this object:
| // moved to https://github.com/ahmadalli/OneLiners#scrool-to-the-buttom-of-lazy-loaded-page |
| # moved to https://github.com/ahmadalli/OneLiners#oneliner-multiple-package-installer |
| ; Adding CapsLock + Arrow Keys as `Home`, `End`, `Page Up`, and `Page Down` shortcuts. | |
| ; It's useful in Asus GL503 Keyboard which you can't use numpad and these keys (except for `Home`) simultaneously | |
| CapsLock & Left::Home | |
| CapsLock & Right::End | |
| CapsLock & Up::PgUp | |
| CapsLock & Down::PgDn |
| # moved to https://github.com/ahmadalli/OneLiners#delete-evicted-pods |