Skip to content

Instantly share code, notes, and snippets.

View paoga87's full-sized avatar

Paola Garcia paoga87

View GitHub Profile
/* 4K */
@media only screen and (min-width: 2560px){
//CSS here
}
/*Desktop */
@media only screen and (min-width: 1025px) and (max-width: 2559px){
//CSS here
}
/* Tablet */
@media only screen and (min-width: 481px) and (max-width: 1024px){
/*
* Simple screenshot test using CasperJS to capture an entire web page
* by Paola Garcia Cardenas
*/
// set screenshot URL variable
var screenshotUrl = 'http://www.paolagarcia.com';
// set viewport size
casper.options.viewportSize = {width: 1928, height: 1274};
@paoga87
paoga87 / git commands
Last active September 11, 2019 03:26
My git commands cheat sheet
Git commands
CREATE NEW BRANCH
git checkout -b new_branch_name
PUSH NEW BRANCH TO REMOTE SERVER
git push -u origin new_branch_name
SWITCH BRANCHES
git checkout branch_name
//Javascript hack from Fullstack Lesson #1: Javascript Craigslist for Fun and Profit
var emails = "";
$(".txt").find("a.hdrlnk").map(function(i, el) { return el })
.each(function(i, el) {
$.get(el.href, function(body) {
$.get( $(body).find("#replylink")[0].href, function(linkbody) {
var email = $(linkbody).find('a[href^="mailto:"]')[0].innerText + ',';
emails += email;
})
<!-- Using PHP's mail() function-->
<?php
$to = 'someone@example.com';
$subject = 'Subject line goes here';
$message = 'Hi, this is me!';
$headers = 'From: info@example.com' . "\r\n" .
'Reply-To: no-reply@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
@paoga87
paoga87 / sorting-elements.js
Last active January 20, 2017 13:24
After having a list of buttons with event dates/names, with the date formatted as string, I decided to re-format the date (after fetching the elements via MySQL/PHP) like this: dd/mm/yyyy, and added each to the individual buttons as IDs. Then do the sorting straight from jQuery. (Querying the MySQL with PHP back-end was not an option because the…
// Functionality to sort the event buttons by date using jQuery
var $results = $('.mainDivClass'); //This could be an id as well
var $itemBtn = $results.children('.individualItemClass'); //This could be an id as well
$itemBtn.detach();
$itemBtn.sort(function(a,b){
return a.id > b.id;
});
@paoga87
paoga87 / postdataArray.php
Last active February 3, 2017 03:30
JSON post data array example, after being decoded
Array
(
[0] => Array
(
[meeting_name] => myMeeting1
[ip] => 00.00.00.00
[response] => 250 message accepted for delivery
[event] => delivered
[email] => myemail@something.com
[timestamp] => 1485811028
@paoga87
paoga87 / v3-hello-email.php
Created February 17, 2017 01:41 — forked from sendgrid-gists/v3-hello-email.php
v3 "Hello World" for email, using SendGrid with PHP.
<?php
// using SendGrid's PHP Library
// https://github.com/sendgrid/sendgrid-php
// If you are using Composer (recommended)
require 'vendor/autoload.php';
// If you are not using Composer
// require("path/to/sendgrid-php/sendgrid-php.php");
@paoga87
paoga87 / endpoint_file.php
Last active February 24, 2017 02:45
This is an example of how the endpoint file looked like. This was set to capture the data SendGrid's webhook was sending.
<?php
date_default_timezone_set('America/New_York');
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$myFile = "tmp/log.txt";
$fh = fopen($myFile, 'a+') or die("can't open file");
if ($fh){
@paoga87
paoga87 / sign_in_sheet.php
Created May 12, 2017 13:18
Example of an automated sign-in sheet, providing users' information and generating a PDF automatically (when user requests it), using the mpdf PHP library
//MySQL queries and other code to generate the $users array ommited
//==============================================================
//==============================================================
//==============================================================
$todayDate = date('m.d.y');
$fileName = 'Sign-In Sheet ' .$todayDate . '.pdf';
include("mpdf60/mpdf.php");