Skip to content

Instantly share code, notes, and snippets.

View adaschevici's full-sized avatar
🦙
Prompting change

Artur Daschevici adaschevici

🦙
Prompting change
View GitHub Profile
class ExampleComponent extends React.Component {
constructor() {
super();
this. _handleClick = this. _handleClick.bind(this);
}
render() {
return <div onClick={this._handleClick}>Hello, world.</div>;
}
_handleClick() {
console.log(this); // this is an ExampleComponent
import itertools
dwarves = ["Gimli", "Fili", "Ilif", "Ilmig", "Mark"]
def is_palindrome(s):
idx = 0
jdx = len(s) - 1
while idx <= jdx:
if s[idx] != s[jdx]:
extern crate hyper;
extern crate encoding;
use hyper::client::Client;
use hyper::header::{Headers,ContentType,UserAgent};
use hyper::mime::Mime;
use std::io::Read;
use encoding::label::encoding_from_whatwg_label;
use encoding::{Encoding, DecoderTrap};
@adaschevici
adaschevici / api.go
Created June 18, 2016 10:48 — forked from peterhellberg/api.go
A tiny example API written in Go using Martini and Redigo
package main
import (
"flag"
"fmt"
"net/http"
"github.com/codegangsta/martini"
"github.com/garyburd/redigo/redis"
"github.com/martini-contrib/render"
@adaschevici
adaschevici / features_steps.py
Created February 4, 2014 10:08
steps to reproduce #373
from lettuce import *
@step('I have the number (\d+)')
def have_the_number(step, number):
world.number = int(number)
@step('I compute its factorial')
@adaschevici
adaschevici / features_steps.py
Created February 4, 2014 10:04
shows steps to reproduce #373
from lettuce import *
@step('I have the number (\d+)')
def have_the_number(step, number):
world.number = int(number)
@step('I compute its factorial')
@adaschevici
adaschevici / good_app_good_app_settings.py
Created December 17, 2013 15:16
return value for process when terrain.py contains import errors
# Django settings for good_app project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS