Skip to content

Instantly share code, notes, and snippets.

View nacholibre's full-sized avatar
💭
Your true wealth is time and freedom, money is just a tool for trading your time

Yoan Arnaudov nacholibre

💭
Your true wealth is time and freedom, money is just a tool for trading your time
View GitHub Profile
<style>
html, body {
height: 100%;
}
.page-wrap {
min-height: 100%;
/* equal to footer height */
margin-bottom: -142px;
}
.page-wrap:after {
'use strict';
var assert = require('assert');
function reverseString(str) {
return str.split('').reverse().join('');
}
function getRotations(str) {
str = str.trim();
'use strict';
function joinParts(str) {
var splitAt = Math.floor(str.length/2);
var left = str.substr(0, splitAt);
var right = str.substr(splitAt);
return right + left;
}
@nacholibre
nacholibre / brackets.js
Last active August 29, 2015 14:22
brackets
'use strict';
var assert = require('assert');
function validate(chr, prevBracket) {
var valid = true;
if (chr === '(' && prevBracket === '{') {
valid = false;
} else if (chr === '[' && prevBracket === '[') {
@nacholibre
nacholibre / gist:58072687059e4e386c8a
Last active April 18, 2017 12:03
Use guzzle with the default Stream Handler, without Curl or any other libraries.
<?php
$handler = new \GuzzleHttp\Ring\Client\StreamHandler();
$client = new GuzzleHttp\Client(['handler' => $handler]);
#container {
width:200px;
height:200px;
border:solid 1px #333;
word-wrap:break-word;
}
p {
white-space: pre-line;
margin:0 5px 0 5px;
@nacholibre
nacholibre / backup.sh
Last active June 27, 2016 09:05
Shell script for server backup (sites and mysql databases) with i/o throttling.
#!/bin/bash
CURRENT_DATE=$(date +'%Y-%m-%d')
MYSQL_USER="mysql_user"
MYSQL=/usr/bin/mysql
MYSQL_PASSWORD="mysql_user_pass"
MYSQLDUMP=/usr/bin/mysqldump
BACKUP_DIR=/DATA/backup/$CURRENT_DATE
SITES_DIR=/www
@nacholibre
nacholibre / readme.md
Last active December 27, 2019 16:02
HOWTO: Install Adobe Photoshop CC on a Case-Sensitive System OSX/MacOS (El Capitan, Sierra)

##Requirements

  1. Xcode

    You can install it from AppStore.

  2. Command Line Tools for Xcode.

    You can install it from Xcode's Preferences -> Downloads.

@nacholibre
nacholibre / index.md
Created February 2, 2017 15:43
Zend php cli optimizations
This file has been truncated, but you can view the full file.
010011000090 I 1 РАЗДЕЛ I - ЖИВИ ЖИВОТНИ И ПРОДУКТИ ОТ ЖИВОТИНСКИ ПРОИЗХОД
010021000090 01 2 010011000090 ГЛАВА 1 - ЖИВИ ЖИВОТНИ
010100000080 0101 3 010021000090 Живи коне, магарета, мулета и катъри
010121000010 4 010100000080 - Коне
010121000080 0101 21 00 5 p/st 010121000010 -- Расови за разплод
010129000080 0101 29 5 010121000010 -- Други
010129100080 0101 29 10 6 p/st 010129000080 --- Предназначени за клане
010129900080 0101 29 90 6 p/st 010129000080 --- Други
010130000080 0101 30 00 4 p/st 010100000080 - Магарета
010190000080 0101 90 00 4 p/st 010100000080 - Други