Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
:)

Cosmin Popescu cosminpopescu14

:octocat:
:)
View GitHub Profile
View ReadCsv.php
<?php
function ReadCsv($file)
{
$handle = fopen($file, "r");
while(!feof($handle))
{
yield fgetcsv($handle);
}
fclose($handle);
@cosminpopescu14
cosminpopescu14 / squash.php
Created May 30, 2018 — forked from woganmay/squash.php
Use PHP to flatten a multidimensional stdClass object (like a json_decode result)
View squash.php
<?php
function squash($array, $prefix = '')
{
$flat = array();
$sep = ".";
if (!is_array($array)) $array = (array)$array;
foreach($array as $key => $value)
View ConstructorsAndProtectedField.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp11
{
class Person
{
@cosminpopescu14
cosminpopescu14 / send_mail.php
Created Jun 3, 2018
snippef for sending mail with php and php mailer
View send_mail.php
<?php
/**
* Created by PhpStorm.
* User: cosmi
* Date: 03-Jun-18
* Time: 3:55 PM
*/
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
View export.sql
-- phpMyAdmin SQL Dump
-- version 4.8.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Jul 28, 2018 at 06:26 PM
-- Server version: 5.7.21-log
-- PHP Version: 7.2.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
View program_wellcode.cpp
// ConsoleApplication12.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <string>
#include <iostream>
using namespace std;
struct Carte {
@cosminpopescu14
cosminpopescu14 / DemoSerialize.java
Created Aug 19, 2018
Java serialize and unserialize object
View DemoSerialize.java
package com.company;
public class DemoSerialize implements java.io.Serializable
{
public int a;
public String b;
public DemoSerialize(int _a, String _b)
View Java11_Features.java
package com.company;
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
@cosminpopescu14
cosminpopescu14 / LuhnAlgorithm.cs
Created Oct 7, 2018
Implementation of Luhn algorithm
View LuhnAlgorithm.cs
using System;
namespace Luhn
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(IsValid());
Console.ReadLine();
View NthRoot.cs
static double ComputeNthRoot(double value, double degree) => Pow(value, (double)(1 / degree));
You can’t perform that action at this time.