Skip to content

Instantly share code, notes, and snippets.

zital ZiTAL

Block or report user

Report or block ZiTAL

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
@ZiTAL
ZiTAL / apt.sh
Last active Aug 29, 2015
debian apt
View apt.sh
#!/bin/bash
# /usr/local/bin/apt
user=`whoami`
commands="apt-get clean; apt-get update; aptitude upgrade; aptitude dist-upgrade"
if [ $user != "root" ]; then
su root -c "${commands}"
else
eval $commands
fi
@ZiTAL
ZiTAL / index.html
Created Nov 7, 2014
pangramak egiteko programatxoa :D
View index.html
<!DOCTYPE html>
<html>
<head>
<title>Pangramak</title>
<style type="text/css">
textarea
{
width: 90%;
min-height: 200px;
}
@ZiTAL
ZiTAL / ftp_raw_list.php
Created Jan 14, 2015
php: ftp raw list desglosea
View ftp_raw_list.php
<?php
$params = array
(
'host' => '127.0.0.1',
'port' => 21,
'user' => 'ftpuser',
'passwd' => 'ftpuser'
);
$conn_id = ftp_connect($params['host'], $params['port']);
$login_result = ftp_login($conn_id, $params['user'], $params['passwd']);
@ZiTAL
ZiTAL / validator.php
Last active Aug 29, 2015
php: html validator
View validator.php
<?php
/*
<!-- validator.txt content -->
<form action="archivo.php" method="get">
<input id="aa" type="text" name="nombre" value="buscar" />
<input id="dd" type="submit" value="buscar" />
</form>
*/
$text = file_get_contents('validator.txt');
@ZiTAL
ZiTAL / svn_revision.php
Created Feb 6, 2015
php: svn get revision files info
View svn_revision.php
<?php
/*
su
aptitute install subversion
exit
*/
$params = array
(
'revision' => 100,
'user' => 'zital',
View pagination.php
<?php
function getPagination($page = 1, $amount = 10)
{
/*
1 -> 10 | 0 -> 9
2 -> 10 | 10 => 19
3 -> 10 | 20 => 29
4 -> 10 | 30 => 39
*/
$page = intval($page);
@ZiTAL
ZiTAL / bytes.js
Last active Aug 29, 2015
bytes converter
View bytes.js
var bytes = 1028653056;
//var bytes = 28653056;
//var bytes = 1;
var types = ['Bytes', 'KiloBytes', 'MegaBytes', 'GigaBytes'];
var result;
var index;
for(var i=0;i<types.length;i++)
{
var z = 1;
View md5.js
(function()
{
function md5cycle(x, k)
{
var a = x[0], b = x[1], c = x[2], d = x[3];
a = ff(a, b, c, d, k[0], 7, -680876936);
d = ff(d, a, b, c, k[1], 12, -389564586);
c = ff(c, d, a, b, k[2], 17, 606105819);
b = ff(b, c, d, a, k[3], 22, -1044525330);
@ZiTAL
ZiTAL / isValidDate.js
Created Apr 29, 2015
javascript: validate date
View isValidDate.js
function isValidDate(data)
{
var m = data.match(/^([0-9]{2})\/([0-9]{2})\/([0-9]{4})\ ([0-9]{2})\:([0-9]{2})\:([0-9]{2})$/);
if(m!=null)
{
var o =
{
d: m[1],
m: parseInt(m[2])-1,
Y: m[3],
@ZiTAL
ZiTAL / txio_random.py
Last active Aug 29, 2015
python: Twitterrera argazki aleatoidxuek idxeteko
View txio_random.py
#!/usr/bin/python2
# -*- coding: utf-8 -*-
#
# pip install TwitterAPI
from TwitterAPI import TwitterAPI
from os import path
from os import listdir
from random import randint
from sys import exit
You can’t perform that action at this time.