Skip to content

Instantly share code, notes, and snippets.

View paoga87's full-sized avatar

Paola Garcia paoga87

View GitHub Profile
@nikcub
nikcub / README.md
Created October 4, 2012 13:06
Facebook PHP Source Code from August 2007
@n1k0
n1k0 / 404checker.js
Created January 11, 2013 10:55
A CasperJS script to check for 404 & 500 internal links on a given website
/**
* This casper scipt checks for 404 internal links for a given root url.
*
* Usage:
*
* $ casperjs 404checker.js http://mysite.tld/
* $ casperjs 404checker.js http://mysite.tld/ --max-depth=42
*/
/*global URI*/
@tsaqib
tsaqib / ideas.md
Last active July 8, 2024 07:53
Ideas that you can use for hackathons, competitions and research.

Ideas

I have collected and moderated these ideas from various public sources and put into one place so that problem solvers and solution developers may find inspirations. Because I wish to update it regularly, I have setup as a single page wiki. You may try these ideas on hackathons/competitions/research; some are quite intense problems and some are not. Many of the problems were prepared keeping Dhaka/Bangladesh in mind, but of course can be applied to just about any underdeveloped/developing and sometimes developed countries.

Categories:
  • Eradicate Extreme Poverty and Hunger
  • Education
  • Healthcare
  • Governance
@sendgrid-gists
sendgrid-gists / v3-hello-email.php
Last active August 9, 2018 17:07
v3 "Hello World" for email, using SendGrid with PHP.
<?php
require 'vendor/autoload.php'; // If you're using Composer (recommended)
// Comment out the above line if not using Composer
// require("<PATH TO>/sendgrid-php.php");
// If not using Composer, uncomment the above line and
// download sendgrid-php.zip from the latest release here,
// replacing <PATH TO> with the path to the sendgrid-php.php file,
// which is included in the download:
// https://github.com/sendgrid/sendgrid-php/releases
@raphaellarrinaga
raphaellarrinaga / drupal_8_twig_cheatsheet.md
Last active July 20, 2023 21:21
[Drupal 8 Twig cheatsheet] #tags: drupal8, twig, cheatsheet

Drupal 8 Twig cheatsheet

Please note I created that sheet as a personal side note/draft and not everything is fully tested. There could be errors or better things to do. So if you spot something wrong or something that can be improved, feel free to comment below and I will do the changes.

Getting Drupal 8 field values in Twig

Image path: {{ file_url(content.field_name['#items'].entity.uri.value) }}

@SpacemanPete
SpacemanPete / gist:c6f576f3a176f7d2b8eb6784a1ab0c5f
Last active October 13, 2020 00:21
Adding first/last/odd/even classes to a twig loop in Drupal 8
{# Borrowed some syntax from https://gist.github.com/NikLP/cb9adc963036d1ffd8896928de2b9b7a and expanded upon it. #}
<div{{ attributes.addClass('container') }}>
{% for item in items %}
{# NB! notation: loop.index is 1 start, loop.index0 is zero start. #}
{# Add first/last/odd/even classes to elements in loop #}
{# odd/even #}
{% set loopClasses = [] %}
{% if loop.index is odd %}
{% set loopClasses = loopClasses|merge(["odd"]) %}