Skip to content

Instantly share code, notes, and snippets.

fghber

  • Pasadena, CA
Block or report user

Report or block fghber

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Ajithkumarsekar
Ajithkumarsekar / README.md
Last active Sep 18, 2018
This python script scrapes the fedex website and outputs the package details on giving the package tracking id as input
View README.md

FEDEX SCRAPER

Question

Question Code:FEDEX
                    Write a Python script which will scrape the FEDEX website to obtain the tracking details of the given shipment tracking details. The output by the script should be in JSON format.
Input: 744668909687
Expected Output:
{ "tracking no": 744668909687,
"ship date": "Wed 19/07/2017",
"status": "delivered",
"scheduled delivery": "Mon 24/07/2017 16:21"

@joyrexus
joyrexus / README.md
Last active Mar 27, 2020
collapsible markdown
View README.md

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
View import_json_appsscript.js
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@pekhee
pekhee / connection.php
Created Apr 5, 2014
Setup database connection for Eloquent outside of Laravel.
View connection.php
<?php // Namespace DB;
use Illuminate\Database\Capsule\Manager as Capsule;
class Connection {
public function __construct()
{
$this->capsule = new Capsule;
// Same as database configuration file of Laravel.
@SimonSimCity
SimonSimCity / pagination.html.twig
Last active Dec 26, 2019
A gist for pagination in Twig, based on the total number of pages, the current page and some URL-settings.
View pagination.html.twig
{#
Source: http://dev.dbl-a.com/symfony-2-0/symfony2-and-twig-pagination/
Updated by: Simon Schick <simonsimcity@gmail.com>
Parameters:
* currentFilters (array) : associative array that contains the current route-arguments
* currentPage (int) : the current page you are in
* paginationPath (string) : the route name to use for links
* showAlwaysFirstAndLast (bool) : Always show first and last link (just disabled)
* lastPage (int) : represents the total number of existing pages
@brandonaaskov
brandonaaskov / jQuery Change Event: Proper Binding
Created Jan 11, 2012
jQuery's change() event doesn't work as expected with input text fields. This, however, does work.
View jQuery Change Event: Proper Binding
/*
For some reason, the change() event only fires when the input field loses focus.
Binding to other options ('change keypress paste focus textInput input') will
fire the event several times, which is bad. The below code works even when
content is pasted into the text field, and only fires once as expected.
*/
$('#search-form .term').bind('input', function(){
console.log('this actually works');
});
@mhawksey
mhawksey / gist:1442370
Last active Mar 18, 2020
Google Apps Script to read JSON and write to sheet
View gist:1442370
function getJSON(aUrl,sheetname) {
//var sheetname = "test";
//var aUrl = "http://pipes.yahoo.com/pipes/pipe.run?_id=286bbb1d8d30f65b54173b3b752fa4d9&_render=json";
var response = UrlFetchApp.fetch(aUrl); // get feed
var dataAll = JSON.parse(response.getContentText()); //
var data = dataAll.value.items;
for (i in data){
data[i].pubDate = new Date(data[i].pubDate);
data[i].start = data[i].pubDate;
}
You can’t perform that action at this time.