Skip to content

Instantly share code, notes, and snippets.

View ozke's full-sized avatar

Miquel Lopez ozke

  • Barcelona
  • 03:08 (UTC +02:00)
  • X @ozke
View GitHub Profile
@ozke
ozke / SMB1OnMavericks
Last active August 29, 2015 14:01
10.9: Switch the SMB stack to use SMB1 as default (from http://hints.macworld.com/article.php?story=20131122083837447)
#If that doesn't help, then there is a way to change all connections that use SMB1 by entering this command in Terminal:
echo "[default]" >> ~/Library/Preferences/nsmb.conf; echo "smb_neg=smb1_only" >> ~/Library/Preferences/nsmb.conf
#To restore the default SMB2 you simply need to delete the newly created configuration file (nsmb.conf) with the command:
rm ~/Library/Preferences/nsmb.conf
@ozke
ozke / ExFATFix
Created May 11, 2014 08:45
Fix for ExFAT disks on Mac
fsck_exfat -d disk0s4
@ozke
ozke / time_elapsed_string.php
Created February 25, 2014 08:48
Return time ago in PHP a-la twitter. Comes from http://viralpatel.net/blogs/twitter-like-n-min-sec-ago-timestamp-in-php-mysql/ but applying strtotime to the parameter.
function time_elapsed_string($original) {
$original = strtotime($original);
// array of time period chunks
$chunks = array(
array(60 * 60 * 24 * 365 , 'year'),
array(60 * 60 * 24 * 30 , 'month'),
array(60 * 60 * 24 * 7, 'week'),
array(60 * 60 * 24 , 'day'),
@ozke
ozke / Social URLs
Last active December 22, 2015 14:39 — forked from Usse/socialEU.js
****TWITTER****
https://twitter.com/intent/tweet?text=[TEXT]
****FACEBOOK****
http://www.facebook.com/sharer.php?u=[URL]
****GOOGLE PLUS****
https://plus.google.com/share?url=[URL]
****PINTEREST****
@ozke
ozke / rAF.js
Last active December 20, 2015 22:59 — forked from paulirish/rAF.js
Paul Irish rAF.js (requestAnimationFrame) with a couple of tweaks to avoid complaining from JSHint
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
@ozke
ozke / gist:5411860
Created April 18, 2013 10:51
MySQL export DB naming convention
__SERVER__-__DB__-%d_%m_%Y_%H_%M_%S
@ozke
ozke / HTML5 empty document
Last active December 16, 2015 00:09
HTML5 empty document
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="author" content="" />
<meta name="robots" content="index, follow" />
<meta name="description" content="" />
<meta name="keywords" content="" />