Skip to content

Instantly share code, notes, and snippets.

# locals only
<Location "/home/mundaka">
order deny,allow
deny from all
allow from 127.0.0.1, localhost
</Location>
@ZiTAL
ZiTAL / 65279.py
Created December 14, 2015 13:12
Remove &#65279; from files
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, os, re
if(len(sys.argv)<2):
print 'Errorea: Karpeta argumentu bidez sartu'
sys.exit()
else:
dir = sys.argv[1]
@ZiTAL
ZiTAL / preload_images.js
Last active January 5, 2016 13:13
javascript: preload images and launch callback
var images_array =
[
'https://upload.wikimedia.org/wikipedia/commons/3/3b/Paris_Tuileries_Garden_Facepalm_statue.jpg',
'https://img.imgur.com/iWKad22.jpg',
'https://this_image_not_exist'
];
var loadImages = function(arr, callback)
{
var count = 0;
@ZiTAL
ZiTAL / loteria_nino.js
Last active December 24, 2015 15:32
"loteria el niño" algoritmoa
/* Datos proporcionados por Europa Press. Queda prohibida su reproduccion total o parcial sin el consentimiento expreso y por escrito. Copyright de esta compilacion: Europa Press - 2015 */
var extracciones = [55487,
43743,
84222,
6691,6989,
285,296,369,466,508,545,635,658,668,692,762,794,873,881,
9,25,34,69,92,
4,5];
/*
var extracciones = [,
@ZiTAL
ZiTAL / order.php
Last active January 15, 2016 09:09
php: dom order nodes
<?php
$xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<root>
<zone type=\"zone_right\">
a
</zone>
<zone type=\"zone_right\">
b
</zone>
@ZiTAL
ZiTAL / css_regex.html
Created January 21, 2016 09:58
css: regex
<!DOCTYPE html>
<html>
<head>
<title>css regex</title>
<style type="text/css">
div
{
width: 120px;
height: 20px;
}
@ZiTAL
ZiTAL / ilargia.json
Last active February 3, 2016 21:13
2016. urteko Ilargi betien datak
[
"2016/01/24",
"2016/02/22",
"2016/03/23",
"2016/04/22",
"2016/05/21",
"2016/06/20",
"2016/07/20",
"2016/08/18",
"2016/09/16",
@ZiTAL
ZiTAL / index.html
Created February 10, 2016 10:12
javascript: input telephone
<input type="tel">
Live example in Codepen: <a href="http://codepen.io/ZiTAL/pen/obJgPz">http://codepen.io/ZiTAL/pen/obJgPz</a>
@ZiTAL
ZiTAL / wait.ino
Last active February 12, 2016 18:56
arduino: wait, function to replace delay
// delay function stops arduino X miliseconds, wait simply wait... :D
// i: miliseconds
void wait(int i)
{
long time = millis()+i;
while(millis()<time)
{
// do... nothing :)
}
@ZiTAL
ZiTAL / ibeacon_detector.ino
Created February 20, 2016 14:45
arduino ibeacon detector
#include <SoftwareSerial.h>
SoftwareSerial BT(7, 8); // 7 Bluetooth TX, 8 Bluetooth RX
void setup()
{
unsigned int total_fail = 0;
unsigned int fail = 0;
unsigned int loops = 0;
float result;