Skip to content

Instantly share code, notes, and snippets.

View musoftware's full-sized avatar
🌏
Working from home

Musoftware musoftware

🌏
Working from home
View GitHub Profile
@musoftware
musoftware / file.py
Created August 2, 2018 23:16
Work With Request and Json
import requests
r = requests.get('https://github.com/timeline.json')
print(r.json()['message'])
@musoftware
musoftware / file.py
Created August 2, 2018 23:14
Open File
def file_get_contents(filename):
with open(filename) as f:
content = f.read()
f.close()
return content
@musoftware
musoftware / Extensions.cs
Created June 23, 2018 19:25
NameValueCollection to postData
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;
public static class Extensions
{
public static string ToPostData(this NameValueCollection @this)
@musoftware
musoftware / AverageValues
Last active October 26, 2017 21:42
AverageValues Calc Best Result
public class AverageValues
{
public int intialValue { get; private set; }
public int currentValue = 0;
double oldResult = 0;
bool StopIncrease = false;
int incrementValue = 0;
public AverageValues(int intialValue = 100, int incrementValue = 10)
{
this.intialValue = intialValue;
@musoftware
musoftware / gist:6373f219e4fbfd9f68bb7ae18e1554ff
Created August 16, 2017 17:32
C# Big Array Class One Dimensional Array Greater than 2Gb.
[Serializable]
public class BigArray<T> : IEnumerable<T>
{
private readonly T[][] _arrays;
public ulong Length { get; private set;}
public T this[ulong index]
{
get
{
@musoftware
musoftware / .htaccess
Created August 5, 2017 00:26
.htaccess for wordpress
# change the <USR> with your cpanel username
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
@musoftware
musoftware / php.ini
Last active July 12, 2020 12:12
Php Config for wordpress
memory_limit = 2048M
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 50000
max_input_vars = 3000
@musoftware
musoftware / threads.cs
Last active July 19, 2017 02:37
Thread Pool
class MyThreadPool
{
private volatile int _inQueue;
private volatile int _outQueue;
private volatile int _total;
CancellationTokenSource cts = new CancellationTokenSource();
public float Percentage
{
get
@musoftware
musoftware / gist:114af452665309c7070aba4aa82447c1
Last active August 16, 2017 17:33
C# BigHashSet Class Greater than 2Gb.
public class BigHashSet<T> : IEnumerable<T>
{
private const ulong StartSize = 1 << 19;
private BigArray<ulong> _hashBuckets;
private ulong _hashCode;
private BigArray<Slot> _slots;
public ulong Count { get; private set; }
public ulong Length {get{
@musoftware
musoftware / bkg.cs
Last active July 4, 2017 19:48
My Background Worker in Button Fast
public class BkGround
{
public class ResultCls
{
public Exception ex { get; set; }
public object output { get; set; }
public ResultCls()
{
}