Skip to content

Instantly share code, notes, and snippets.

View sidrafarooq's full-sized avatar

Sidra Farooq sidrafarooq

  • Pakistan
View GitHub Profile
  1. First get to the existing directory
    $ cd my/folder/

  2. Now start a new git repository
    $ git init

  3. Identify if the current elements on the directory are needed or not and add them to the .gitignore file. When ready...
    $ vim .gitignore

  4. When ready create the first commit on the server

@sidrafarooq
sidrafarooq / mysql.load-infile.php
Created August 23, 2020 12:01 — forked from xeoncross/mysql.load-infile.php
Sample loading data using MySQL's LOAD DATA INFILE
<?php
// http://www.phpfreaks.com/forums/index.php?topic=290985.0
//create table in database
$sql1 = "
CREATE TABLE IF NOT EXISTS `test` (
`id` int(11) NOT NULL auto_increment,
`type` text NOT NULL,
`command` text NOT NULL,
`value` text NOT NULL,
FulfillmentCenter Location Country SquareFeet YearOpened Description of Operation
PHX3 6835 West Buckeye Road, Phoenix, Arizona, 85043 1,000,000 September2007 Large Sortable Fulfillment CenterOriginally opened at 605,000 Sq. Ft. Expanded by 400,000 Sq. Ft.  in Dec. 2011
PHX5 16920 W. Commerce Dr. , Goodyear, Arizona, 85338-3620 1,200,000 June2008 Non-sortable Fulfillment CenterOriginally opened at 800,000 Sq. Ft. Expanded to 1.2 Million Sq. Ft + a 230,000 sq ft mezzanine in 2011.
PHX6TFC1 4750 & 5050 West Mohave Street, Phoenix, Arizona, 85043-4428 1,207,000 October 2010 Large Sortable Fulfillment Center in one half of the buildingSmall Sortable Fulfillment Center in the other half
PHX7 800 N. 75th Ave, Phoenix, Arizona, 85043-3101 1,200,000 September2011 Small Sortable and Non Sortable Fulfillment Center
UAZ1 Phoenix, Arizona, 85001   2015 Prime Now Hub
ONT2 1910 E. Central Ave., Southgate Building 3, San Bernardino, California, 92408-0123 951,700 October 2012 Small Sortable
@sidrafarooq
sidrafarooq / background.js
Created April 5, 2017 21:37 — forked from Rob--W/background.js
Implementation example of writable response bodies for Chromium extensions (API draft).
/**
* Implementation example of writable response bodies.
* Based on the draft of the Streams API (19 March 2014)
* https://dvcs.w3.org/hg/streams-api/raw-file/tip/Overview.htm
* Design document for response body reading/writing:
* https://docs.google.com/document/d/1iE6M-YSmPtMOsec7pR-ILWveQie8JQQXTm15JKEcUT8
*/
/* globals chrome, ByteStream, URL, XMLHttpRequest */
'use strict';
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="http://code.jquery.com/jquery-1.12.0.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
</head>
<body>
@sidrafarooq
sidrafarooq / examples.js
Created August 23, 2016 10:59 — forked from hcientist/examples.js
working with recipes in mongo
var r = { //first i will show an example where i just store the value of the recipe key, because there were no other keys in the example you sent me
"publisher": "All Recipes",
"f2f_url": "http://food2fork.com/view/521",
"ingredients": [
"For Cupcakes:",
"1 (18.25 ounce) package white cake mix with pudding",
"1/3 cup vegetable oil",
"3 egg whites",
"1 1/4 cups water",
"6 ounces bittersweet chocolate, chopped fine",
define ("AWS_ACCESS_KEY_ID", "xxxxx");
define ("MERCHANT_ID", "xxxxx");
define ("MARKETPLACE_ID", "xxxxx");
define ("AWS_SECRET_ACCESS_KEY","xxxxx");
$base_url = "https://mws.amazonservices.com/Products/2011-10-01";
$method = "GET";
$host = "mws.amazonservices.com";
$uri = "/Products/2011-10-01";
@sidrafarooq
sidrafarooq / amazon-orders-api.php
Created March 3, 2016 22:35 — forked from underdown/amazon-orders-api.php
Amazon MWS Orders API PHP Example
<?php
/*******************************************************************************
* Copyright 2009-2015 Amazon Services. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
*
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at: http://aws.amazon.com/apache2.0
* This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
<ul class="events">
<?php
$atts = array(
'title' => NULL,
'limit' => 100,
'css_class' => NULL,
'show_expired' => FALSE,
'month' => NULL,
'category_slug' => NULL,
'order_by' => 'start_date',
# You can pull additional data in the SELECT if needed
SELECT post_name, post_date, post_author,
post_status, post_parent, meta_value
# Both tables contain all the data you'll ever need with the plugin
FROM wp_posts
INNER JOIN wp_postmeta
ON wp_posts.ID = wp_postmeta.post_id
# You can set this to funder if you want to pull details on funds