Skip to content

Instantly share code, notes, and snippets.

💭
:)

Cosmin Popescu cosminpopescu14

💭
:)
Block or report user

Report or block cosminpopescu14

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
@cosminpopescu14
cosminpopescu14 / main.go
Created Aug 14, 2019 — forked from geosoft1/main.go
Simple blockchain example
View main.go
package main
import (
"crypto/sha256"
"encoding/hex"
"strconv"
"time"
)
type Data struct {
View Output HashMap with JSF 2.2
Methode 1
<p:dataTable var="entry" value="#{hashMap.entrySet().toArray()}">
<p:column headerText="key">
<h:outputText value="${entry.key}" />
</p:column>
<p:column headerText="value id">
<h:outputText value="${entry.value.id}" />
</p:column>
</p:dataTable>
@cosminpopescu14
cosminpopescu14 / .htaccess
Created Dec 9, 2018 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
View .htaccess
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@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)
@cosminpopescu14
cosminpopescu14 / curl-post.php
Created Apr 16, 2018 — forked from lesstif/curl-get.php
PHP CURL POST example
View curl-post.php
<?php
class Log {
public static function debug($str) {
print "DEBUG: " . $str . "\n";
}
public static function info($str) {
print "INFO: " . $str . "\n";
}
}
You can’t perform that action at this time.