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 / nlist_ftp.php
Created March 29, 2014 22:29
Search Ftp
function list_all_files($conn_id, $path){
$buff = ftp_rawlist($conn_id, $path);
$res = parse_rawlist( $buff) ;
static $flist = array();
if(count($res)>0){
foreach($res as $result){
// verify if is dir , if not add to the list of files
if($result['size']== 0){
// recursively call the function if this file is a folder
list_all_files($conn_id, $path.'/'.$result['name']);
@musoftware
musoftware / Thread.sleep.cs
Last active August 29, 2015 14:08
Best way to Make Thread.sleep replacement without hang
//Install PM> Install-Package Microsoft.Bcl.Async
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
class ExTask : Task
{
public ExTask(Action action)
@musoftware
musoftware / program.cs
Created December 5, 2014 22:39
More User Input of Data
//Please enter the details:
//First name:
//Last name:
//Grade(9-12):
//Student Id:
//Username:
//GPA(0.0-4.0):
//Plex
//Vera
//9
@musoftware
musoftware / sum_logical.cs
Created August 15, 2015 16:59
sum_logical
int sum = 0;
int input = 10000000000;
for(int i =0;i <= input;i++){
sum += i;
}
Console.WriteLine(sum);
@musoftware
musoftware / sum_arithmetic.cs
Created August 15, 2015 17:04
sum in arithmetic
uint p = 10000000
uint sum = p*(p+1)/2;
@musoftware
musoftware / bulk_html_encode.php
Last active September 24, 2015 17:34
bulk_html_encode.php
<?php
/*
I fact problem when I want make html_encode to more than item on array or object I retreved from Model in Codeigniter to
put them on Form or print them and because I don't want to encode or escape html from model and also lazy to do that each time
with each item :D
*/
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
if (!function_exists('bulk_html_encode')) {
@musoftware
musoftware / check-proxy
Created October 10, 2015 03:49
check-proxy
check-proxy
@musoftware
musoftware / file.cs
Created October 30, 2015 21:50
Use WCF Service ON Dll file
var binding = new WSHttpBinding();
binding.SendTimeout = new TimeSpan(0, 0, 0, 0, 100000);
binding.OpenTimeout = new TimeSpan(0, 0, 0, 0, 100000);
binding.MaxReceivedMessageSize = 10000;
binding.ReaderQuotas.MaxStringContentLength = 10000;
binding.ReaderQuotas.MaxDepth = 10000;
binding.ReaderQuotas.MaxArrayLength = 10000;
var endpoint = new EndpointAddress("http://localhost:57102/MyService.svc");
var myClient = new WebServiceclient(binding, endpoint);
@musoftware
musoftware / code.am
Created November 6, 2015 17:16
add me fast Bot in AM CODE
wb = InitBrowser( )
wb?setlocation(-8, -8)
wb?setsize(1382, 744)
wb?Goto("http://addmefast.com/free_points/facebook_likes")
sleep(1000)
wb?ScrollTo(0,240)
wb?Click(701,409)
sleep(10000)
wb?SelectTab(1)
wb?ScrollTo(0,0)
@musoftware
musoftware / UnixTimestampConverter.cs
Created April 19, 2016 22:51
Unix Timestamp Converter
internal static class UnixTimestampConverter
{
public static DateTime Epoch
{
get
{
return new DateTime(1970, 1, 1, 0, 0, 0, 0);
}
}