Skip to content

Instantly share code, notes, and snippets.

View Nav-Appaiya's full-sized avatar
🏠
Available

Nav Appaiya Nav-Appaiya

🏠
Available
View GitHub Profile
<?php
use Symfony\Component\HttpFoundation\File\File;
use Symfony\Component\HttpFoundation\File\UploadedFile;
/**
* @Entity
*/
class Document
{
INSERT INTO `markers` (`name`, `address`, `lat`, `lng`) VALUES ('Frankie Johnnie & Luigo Too','939 W El Camino Real, Mountain View, CA','37.386339','-122.085823');
INSERT INTO `markers` (`name`, `address`, `lat`, `lng`) VALUES ('Amici\'s East Coast Pizzeria','790 Castro St, Mountain View, CA','37.38714','-122.083235');
INSERT INTO `markers` (`name`, `address`, `lat`, `lng`) VALUES ('Kapp\'s Pizza Bar & Grill','191 Castro St, Mountain View, CA','37.393885','-122.078916');
INSERT INTO `markers` (`name`, `address`, `lat`, `lng`) VALUES ('Round Table Pizza: Mountain View','570 N Shoreline Blvd, Mountain View, CA','37.402653','-122.079354');
INSERT INTO `markers` (`name`, `address`, `lat`, `lng`) VALUES ('Tony & Alba\'s Pizza & Pasta','619 Escuela Ave, Mountain View, CA','37.394011','-122.095528');
INSERT INTO `markers` (`name`, `address`, `lat`, `lng`) VALUES ('Oregano\'s Wood-Fired Pizza','4546 El Camino Real, Los Altos, CA','37.401724','-122.114646');
INSERT INTO `markers` (`name`, `address`, `lat`, `lng`) VALU
@Nav-Appaiya
Nav-Appaiya / index.php
Created May 16, 2015 20:43
My bootstrap landingpage for navappaiya.me
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Nav Appaiya development host, setup to test, serve, or host stuff. http://navappaiya.nl">
<meta name="author" content="Nav Appaiya">
@Nav-Appaiya
Nav-Appaiya / gist:925473a8a5974ec441ec
Created May 16, 2015 22:05
My bootstrap landingpage for navappaiya.me - UPATED V1.2
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Nav Appaiya development host, setup to test, serve, or host stuff. http://navappaiya.nl">
<meta name="author" content="Nav Appaiya">
@Nav-Appaiya
Nav-Appaiya / config.yml
Created May 24, 2015 14:59
Setting a base path for assets in symfony2 =>{{ asset('css/style.css') }} instead of the full path
framework:
#esi: ~
#translator: { fallbacks: ["%locale%"] }
secret: "%secret%"
router:
resource: "%kernel.root_dir%/config/routing.yml"
strict_requirements: ~
form: ~
csrf_protection: ~
validation: { enable_annotations: true }
@Nav-Appaiya
Nav-Appaiya / gist:39b7121fa9cd7654dc0d
Created June 7, 2015 23:42
Laracast theme for PHPStorm
<?xml version="1.0" encoding="UTF-8"?>
<scheme name="LaracastsTheme" version="124" parent_scheme="Default">
<option name="LINE_SPACING" value="1.4" />
<option name="EDITOR_FONT_SIZE" value="13" />
<option name="EDITOR_FONT_NAME" value="SourceCodePro-Regular" />
<colors>
<option name="ADDED_LINES_COLOR" value="292d38" />
<option name="ANNOTATIONS_COLOR" value="212427" />
<option name="CARET_COLOR" value="7b7d83" />
<option name="CARET_ROW_COLOR" value="" />
@Nav-Appaiya
Nav-Appaiya / gist:a54d579c49c477bc98e0
Created June 8, 2015 21:10
Removing all the .AppleDouble folders from your project in 1 command.
If you’ve shared your Windows / Unix drives with Mac OS X before, you may notice that Mac OS X will leave some footprints on your shared folders, such as .DS_Store and .AppleDouble. These files and directories are pretty annoying because they showed up in almost every single directory you accessed from the OS X.
find . -name \.AppleDouble -exec rm -rf {} \;
@Nav-Appaiya
Nav-Appaiya / FeedBurner.php
Created June 22, 2015 18:49
My FeedBurner class for pulling in news
<?php
/**
* Created by PhpStorm.
* User: Nav
* Date: 7-6-2015
* Time: 20:21
*/
namespace Nav\ToolBoxBundle\Controller;
@Nav-Appaiya
Nav-Appaiya / unzip.php
Created June 24, 2015 19:57
PHP Unzipper in a few lines, very sweet!
<?php
$unzip = new ZipArchive;
$out = $unzip->open('wordpress-4.2.2-nl_NL.zip');
if ($out === TRUE) {
$unzip->extractTo(getcwd());
$unzip->close();
echo 'File unzipped';
} else {
echo 'Something went wrong?';
@Nav-Appaiya
Nav-Appaiya / gist:2afb74e905c6e5126b25
Created July 11, 2015 13:11
quotesondesign.com scraping quotes with YQL!
A scrape from quotesondesign.com to harvest some nice quotes using Yahoo Query Language (YQL!)
QUERY:
select * from html where url="http://quotesondesign.com/" and
xpath='//*[@id="quote-content"]/p/text()[1]'
YQL Query URL:
https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20url%3D%22http%3A%2F%2Fquotesondesign.com%2F%22%20and%0A%20%20%20%20%20%20xpath%3D'%2F%2F*%5B%40id%3D%22quote-content%22%5D'&diagnostics=true
YQL Query URL simple & json: