Skip to content

Instantly share code, notes, and snippets.

View zafe's full-sized avatar
💭
Esslingen, Deutschland 🇩🇪

Fernando Zafe zafe

💭
Esslingen, Deutschland 🇩🇪
View GitHub Profile
@zafe
zafe / tecnomate.cpp
Last active September 17, 2015 00:14
#include <iostream>
#include <string>
#include <algorithm>
#include <iterator>
#include <vector>
using namespace std;
int main(){
@zafe
zafe / FileWriterExample.java
Last active August 29, 2015 14:22
Write a file in android using FileWriter
package com.paad.comparison;
import java.io.FileOutputStream;
import java.io.FileWriter;
import android.app.Activity;
import android.os.Bundle;
public class ComparisonOfControlCreationActivity extends Activity {
@Override
@zafe
zafe / gist:2351bf6b9525a1655cda
Created June 3, 2015 19:18
Write a file in android
public static void write (String filename,Context c,String string) throws IOException{
try {
FileOutputStream fos = c.openFileOutput(filename, Context.MODE_PRIVATE);
fos.write(string.getBytes());
fos.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
@zafe
zafe / bus.json
Last active August 29, 2015 14:20
{
"buses":[
{
"origin":"La Florida",
"destiny":"Delfin Gallo",
"time":"05:30"
},
{
"origin":"Los Ralos",
"destiny":"Ranchillos",
@zafe
zafe / template.json
Created May 1, 2015 06:48
json bus-time template
{
{
"origin": "SMT",
"destiny": "FLO",
"days": ["L","M","X","J","V"],
"timetable":
[
{
"time":"05:00",
"branch":"ALD"
@zafe
zafe / palindrome.js
Last active August 29, 2015 14:19
palindrome() function
function ispalindrome(){
var palindrome = true;
var text = "arra";
var array = text.toUpperCase();
array = array.split(" ");
array = array.join("");
for(var i in array)
{
@zafe
zafe / crypt.php
Last active August 29, 2015 14:11
Login with PHP using crypt()
<?php
define($hash_token,"$%&123");//$hash_token is the key to use in crypt()
public function crypt_password($password){
return $encripted_password = crypt($password,$hash_token);
}
public function login($user_name, $dumb_password){