I hereby claim:
- I am mtco on github.
- I am bleh (https://keybase.io/bleh) on keybase.
- I have a public key ASAk1-VrvHIL6Hb5laXnEf8HEiSkaJFIHuAcjWTcaaJJ0Ao
To claim this, I am signing this object:
| For | |
| * ES5 | |
| * ES6 | |
| * CoffeeScript |
| /* | |
| * http://www.myersdaily.org/joseph/javascript/md5-text.html | |
| */ | |
| (function (global) { | |
| var md5cycle = function (x, k) { | |
| var a = x[0], | |
| b = x[1], | |
| c = x[2], | |
| d = x[3]; |
| <?php | |
| function slugify($str) { | |
| $search = array('Ș', 'Ț', 'ş', 'ţ', 'Ş', 'Ţ', 'ș', 'ț', 'î', 'â', 'ă', 'Î', 'Â', 'Ă', 'ë', 'Ë'); | |
| $replace = array('s', 't', 's', 't', 's', 't', 's', 't', 'i', 'a', 'a', 'i', 'a', 'a', 'e', 'E'); | |
| $str = str_ireplace($search, $replace, strtolower(trim($str))); | |
| $str = preg_replace('/[^\w\d\-\ ]/', '', $str); | |
| $str = str_replace(' ', '-', $str); | |
| return preg_replace('/\-{2,}', '-', $str); | |
| } |
I hereby claim:
To claim this, I am signing this object:
Regarding Leigh Purdie's comment (from 4 years ago) about stream_get_line being better for large files, I decided to test this in case it was optimized since then and I found out that Leigh's comment is just completely incorrect
fgets actually has a small amount of better performance, but the test Leigh did was not set up to produce good results.
The suggested test was:
The Dark Knight subtitles:
1 00:01:45,089 --> 00:01:47,924 Three of a kind, let's do this. that's it? three guys?
2 00:01:48,092 --> 00:01:51,426 Two guys on the roof. every guy gets a share. five shares is plenty.
The pomodoro clock is a time management tecnique that uses a timer to separate your work time in smaller intervals with pauses in between to boost your mental agility. This pomodoro has a sound effect on so you know when your work/relax time is over!
A Pen by Francesco Agnoletto on CodePen.
| #!/bin/bash | |
| FW="/sbin/iptables" | |
| SSH_PORTS="22" | |
| WEB_PORTS="80 443" | |
| DNS_NAMESERVERS="8.8.8.8 8.8.4.4" | |
| NTP_NAMESERVERS="" | |
| PKG_NAMESERVERS="ftp.debian.org security.debian.org" |
| #!/bin/bash | |
| # Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04 | |
| # Inspired from https://gist.github.com/faleev/3435377 | |
| # Remove any existing packages: | |
| sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev | |
| # Get the dependencies (Ubuntu Server or headless users): | |
| sudo apt-get update |
| #!/usr/bin/python | |
| # TODO make range command line arguments | |
| import sys, codecs | |
| sys.stdout = codecs.getwriter('utf-8')(sys.stdout) # if your terminal can't do utf-8, well... | |
| import time | |
| import urllib2 | |
| import BeautifulSoup |