This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
su | |
aptitute install subversion | |
exit | |
*/ | |
$params = array | |
( | |
'revision' => 100, | |
'user' => 'zital', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
host='127.0.0.1' | |
user='user' | |
passwd='passwd' | |
local_folder='/home/projects/example/public_html/application/views/layout/heavymetal' | |
remote_folder='/public_html/application/views/layout/heavymetal' | |
file='heavymetal_eu.php' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# script-eri aldatu "_" "/" euren path-a jakitzeko | |
# gero github-etik proeiktue bajatu | |
cd /usr/src | |
git clone https://github.com/porjo/mt7601.git | |
# baimenak emon | |
chmod 755 /etc/init.d/ralink | |
chmod 755 /usr/local/sbin/ralink |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// array guztiari funtzio bera aplikatzeko erabiliko dugu | |
var zenbakiak = [1, 2, 3]; | |
// funtzioak parametro moduan array-aren balorea hartzen du (i) | |
var erantzuna = zenbakiak.map(function(i) | |
{ | |
return i+1; | |
}); | |
console.log(erantzuna); | |
// [ 2, 3, 4 ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
host='127.0.0.1' | |
user='user' | |
pass='passwd' | |
local_folder='/home/projects/example/public_html/application/views/layout/home' | |
remote_folder='/public_html/application/views/layout/home' | |
file='home_eu.php' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// HM10 Bluetooth arduino modules response example | |
$text = "OK+DISISOK+DISC:4C000215:74278BDAB64445208FOC720EAF059935:FFEOFFE1C5:78A5048CECAC:-0620K+DISC:4C000215:74278BDAB64445208F0C720EAf059935:FFFE0FFE1C5:78A50485AF2D:-0580K+DISCE"; | |
//preg_match_all("/\+DISC\:([A-Z0-9]+\:[A-Z0-9]+\:[A-Z0-9]+\:[A-Z0-9]+)\:([A-Z0-9\-]+)/", $text, $m); | |
preg_match_all("/\+DISC\:(\w+\:\w+\:\w+\:\w+)\:([\w\-]+)/", $text, $m); | |
print_r($m); | |
// output |