Skip to content

Instantly share code, notes, and snippets.

View djonatanb's full-sized avatar

Djonatan Buss djonatanb

  • Wunderman Thompson Technology Brasil
  • Pelotas, RS
View GitHub Profile
a[href^="http://click.plista.com/pets"],
a[href^="http://ads2.williamhill.com/redirect.aspx?"],
a[href^="http://www.digg.com/submit?"],
a[href^="https://facebook.com/sharer.php?"],
a[href="http://twitter.com/share"],
a[href^="https://www.facebook.com/sharer.php?"],
a[href^="http://facebook.com/sharer.php?"],
a[href^="http://plus.google.com/share?url="],
a[href^="https://www.stumbleupon.com/submit?url="],
a[href^="http://twitter.com/home?"],
@djonatanb
djonatanb / The Technical Interview Cheat Sheet.md
Created December 4, 2016 22:59 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
if [(].*[)][\s][^{]
if (winAAdDD) {
gameMap.addResultToMap("Win");
JOptionPane.showMessageDialog(mainGameView, "Good Job! You win!");
}
if (wawa)
asdasdas
SELECT table_name "Tables",
( data_length + index_length ) / 1024 /
1024 "Table Size in MB",
( data_free )/ 1024 / 1024 "Free Space in MB"
FROM information_schema.TABLES
where table_schema="area"
@djonatanb
djonatanb / gist:8787074
Created February 3, 2014 16:26
fixing php-fpm ownership
/etc/php5/fpm/pool.d
@djonatanb
djonatanb / gist:7607130
Created November 22, 2013 21:23
UTF-8 right charset for database
"utf8_unicode_ci is generally more accurate for all scripts. For example, on Cyrillic block: utf8_unicode_ci is fine for all these languages: Russian, Bulgarian, Belarusian, Macedonian, Serbian, and Ukrainian. While utf8_general_ci is fine only for Russian and Bulgarian subset of Cyrillic. Extra letters used in Belarusian, Macedonian, Serbian, and Ukrainian are sorted not well."
<select>
<option timeZoneId="1" gmtAdjustment="GMT-12:00" useDaylightTime="0" value="-12">(GMT-12:00) International Date Line West</option>
<option timeZoneId="2" gmtAdjustment="GMT-11:00" useDaylightTime="0" value="-11">(GMT-11:00) Midway Island, Samoa</option>
<option timeZoneId="3" gmtAdjustment="GMT-10:00" useDaylightTime="0" value="-10">(GMT-10:00) Hawaii</option>
<option timeZoneId="4" gmtAdjustment="GMT-09:00" useDaylightTime="1" value="-9">(GMT-09:00) Alaska</option>
<option timeZoneId="5" gmtAdjustment="GMT-08:00" useDaylightTime="1" value="-8">(GMT-08:00) Pacific Time (US & Canada)</option>
<option timeZoneId="6" gmtAdjustment="GMT-08:00" useDaylightTime="1" value="-8">(GMT-08:00) Tijuana, Baja California</option>
<option timeZoneId="7" gmtAdjustment="GMT-07:00" useDaylightTime="0" value="-7">(GMT-07:00) Arizona</option>
<option timeZoneId="8" gmtAdjustment="GMT-07:00" useDaylightTime="1" value="-7">(GMT-07:00) Chihuahua, La Paz, Mazatlan</option>
<option timeZoneId="9" gmtAdjustment="GMT-
@djonatanb
djonatanb / gist:6625988
Last active December 23, 2015 11:09
Resume a large scp transfer
rsync --partial --progress --rsh=ssh user@host:remote_file local_file
//get rid of this
$countries = $this->Network->Country->find('list');
//and use this
$countries = $this->Network->find('list', array('contain' => 'Country');
//both using this in the view
echo $this->Form->input('Country');
@djonatanb
djonatanb / reup
Created April 9, 2012 20:07
Save with time
public function beforeSave($options = array())
{
foreach ($this->_youtube as $youtube) {
if (isset($this->data[$this->alias])
&& isset($this->data[$this->alias][$youtube])
) {