Skip to content

Instantly share code, notes, and snippets.

View Natshah's full-sized avatar
💻
Automating the Automated

Rajab Natshah Natshah

💻
Automating the Automated
View GitHub Profile
@necolas
necolas / contain-floats.css
Created April 22, 2011 00:36
Cross-browser, consistent float-containment methods
/*
* Containing floats in a consistent manner
* By Jonathan Neal and Nicolas Gallagher
*/
/*
* New block formatting context method
* IE 6+, Firefox 2+, Safari 4+, Opera 9+, Chrome
*/
// Init style shamelessly stolen from jQuery http://jquery.com
var Froogaloop = (function(){
// Define a local copy of Froogaloop
function Froogaloop(iframe) {
// The Froogaloop object is actually just the init constructor
return new Froogaloop.fn.init(iframe);
}
var eventCallbacks = {},
hasWindowEvent = false,
@alotaiba
alotaiba / google_text2speech.md
Created February 3, 2012 07:31
Google Text to Speech API

Google Text to Speech API

Base URL: http://translate.google.com/translate_tts
It converts written words into audio. It accepts GET requests.

GET

q
The query string to convert to audio

tl
Translation language, for example, ar for Arabic, or en-us for English

@wizonesolutions
wizonesolutions / README.md
Last active April 10, 2017 15:26
Drupal script to fix field collection items associated with multiple entities due to Content Translation/Node Clone bug.

Explanation

Drupal script to fix field collection items associated with multiple entities due to Content Translation/Node Clone bug.

**NOTE: This update hook gives every field collection item found to be associated with more than one node a new item_id. I haven't experienced any problems with doing this, but if you are doing anything special in your use case with the item_ids or revision_ids of field collection items, you should test thoroughly after running this update.

You should test thoroughly anyway, really.

TAKE A BACKUP.

How to use

<?php
/**
* @file
* Contains Drupal\Core\Plugin\Discovery\YamlDiscovery.
*/
namespace Drupal\Core\Plugin\Discovery;
use Drupal\Component\Plugin\Discovery\DiscoveryInterface;
@julionc
julionc / 00.howto_install_phantomjs.md
Last active April 26, 2024 09:13
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
@didats
didats / nationality.html
Created December 28, 2013 00:00
Nationality List in HTML Dropdown
<select name="nationality">
<option value="">-- select one --</option>
<option value="afghan">Afghan</option>
<option value="albanian">Albanian</option>
<option value="algerian">Algerian</option>
<option value="american">American</option>
<option value="andorran">Andorran</option>
<option value="angolan">Angolan</option>
<option value="antiguans">Antiguans</option>
<option value="argentinean">Argentinean</option>
@salsalabs
salsalabs / embed_signup.html
Last active November 11, 2016 16:22
Signup form in your web page
<form action="https://API_HOST/save" method="POST">
<input type="hidden" name="organization_KEY" value="5881"/>
<input type="hidden" name="chapter_KEY" value="887"/>
<input type="hidden" name="email_trigger_KEYS" value="12644,12656"/>
<input type="hidden" name="object" value="supporter"/>
<input type="hidden" name="Receive_Email" value="1"/>
<label for="first_name">First Name:</label><input type="text" id="first_name" name="First_Name"/><br/>
<label for="last_name">Last Name:</label><input type="text" id="last_name" name="Last_Name"/><br/>
<label for="email">Email:</label><input type="text" id="email" name="Email"/><br/>
<style>.memberCode{display:none;}</style>
@scmx
scmx / upgrade-install-ruby-2-1-2-ubuntu-12-04.md
Last active November 6, 2019 15:31
Upgrade/Install ruby 2.1.2 #ubuntu #12.04 #14.04

Upgrade/Install ruby 2.1.2

ubuntu 12.04 14.04

Reference http://stackoverflow.com/a/18490935/2037928

Login as root

Install needed packages

apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
#!/bin/sh
#
# This hook prevents you from committing any file containing the
# words "alert|die|print_r".
#
# The idea is that I can add a comment to prevent myself from
# committing a change related to debugging or hacking.
#
# To enable this hook, rename this file to ".git/hooks/pre-commit".