Skip to content

Instantly share code, notes, and snippets.

View cfierbin's full-sized avatar

Cristina Fierbinteanu cfierbin

  • Bucharest, Romania
View GitHub Profile
#include <iostream>
#include <optional>
std::optional<std::string> Speak()
{
return { "Excellent!" };
}
int main()
{
#include <iostream>
#include <string>
using namespace std;
class Robot
{
public:
void spune (string propozitie)
package parallelStreamsOfIntegers;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
class MyClass {
MyClass() {
System.out.println("MyClass");
}
MyClass(String id) {
System.out.println("MyClass " + id);
}
}
@cfierbin
cfierbin / VoteServerServlet.java
Created April 26, 2016 06:50
Vote Server Servlet
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
PrintWriter out = response.getWriter();
String button1 = request.getParameter("smile");
String button2 = request.getParameter("wait");
if (button1 != null) {
out.println("<html><body>");
out.println("<h1>Smile!!!</h1>");
out.println("</body></html>");
@cfierbin
cfierbin / WindyAfternoon.html
Created April 26, 2016 06:46
Client Side of VoteMyHaiku App
<div>
<h2>Windy Afternoon</h2>
<p>Windy afternoon</p>
<p>Your smile</p>
<p>On a stranger's face</p>
<form action=http://votemyhaiku.azurewebsites.net/VoteMyHaiku/vote method=Get>
<input type=Submit name="smile" value="Like" class="my_button"/>
@cfierbin
cfierbin / quotesStep1.js
Created April 1, 2016 06:58
Angular 2 Random Quote Generator, Step 1
// import does not work in Codepen
// using const instead
const {Component, Inject} = ng.core;
const {bootstrap} = ng.platform.browser;
const {HTTP_PROVIDERS, Http, Response} = ng.http;
@Component({
selector: 'my-app',
template: '<h1>{{ quote }}</h1>'
})
{ "quotes":
[
{
"quote": "It is only with the heart that one can see rightly.",
"author": "Antoine de Saint-Exupery",
"tags": [ "inspiration", "success" ],
"category": "StExupery",
"title": "My Favourite Quote",
"id": ""
}
package enums;
enum CardTypes {
CLUBS, // ♣
DIAMONDS,//♦
HEARTS, //♥
SPADES // ♠
}
public class playingCards {
function end(str, target) {
// "Never give up and good luck will find you."
// -- Falcor
//find position of first character of target in str
var last = lastMatch(str, target);
if ((last >= 0) && (target.length == str.length-last)){
for (var i=last+1; i<target.length-1; i++){
if (str[i] !== target [i-last]) {