Skip to content

Instantly share code, notes, and snippets.

View alaahd's full-sized avatar

Alaa Hadad alaahd

View GitHub Profile
pragma solidity ^0.4.24;
contract registry{
struct Certificate {
mapping(address => bool) attested;
mapping(address => string) ipfsRootHash;
}
mapping(string => Certificate) certificates;
pragma solidity ^0.4.24;
import "github.com/Arachnid/solidity-stringutils/strings.sol";
contract registry {
using strings for *;
struct Certificate {
//mapping(address => bool) attested;
mapping(address => string) ipfsRootHash;
}
@alaahd
alaahd / Adoption.sol
Created July 13, 2018 19:39
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=true&gist=
pragma solidity ^0.4.24;
contract Adoption {
address[16] public adopters;
mapping(address => bool) adapted;
modifier whenRangeIsValid(uint petId) {
/// we need to check first if the range is valid
require(petId >= 0 && petId <= 15);
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.16/vue.js"></script>
<!-- Since there is already a rich ecosystem of ajax libraries -->
<!-- and collections of general-purpose utility methods, Vue core -->
<!-- is able to remain small by not reinventing them. This also -->
https://developer.jwplayer.com/jw-player/docs/developer-guide/api/javascript_api_introduction/
@alaahd
alaahd / OPT_DFP
Last active August 29, 2015 13:56
OPT takeovers dfp code
<script type="text/javascript">
var adClickURL = "%%CLICK_URL_ESC%%%%DEST_URL%%";
parent.adClickURL = adClickURL;
$(document).ready( function() {
$(window.parent.document).find('body').css("backgroundColor", "#FFFFFF");
$(window.parent.document).find('body').css("backgroundImage", "url('%%VIEW_URL_UNESC%%https://s3.amazonaws.com/sport360/new-umbro.jpg')");
$(window.parent.document).find('body').css("backgroundPosition", "top center");
$(window.parent.document).find('body').css("backgroundRepeat", "no-repeat");
SELECT node.nid AS nid,
node_data_field_main_image.field_main_image_fid AS node_data_field_main_image_field_main_image_fid,
node_data_field_main_image.field_main_image_list AS node_data_field_main_image_field_main_image_list,
node_data_field_main_image.field_main_image_data AS node_data_field_main_image_field_main_image_data,
node.language AS node_language,
node.type AS node_type,
node.vid AS node_vid,
node_revisions.body AS node_revisions_body,
node_revisions.format AS node_revisions_format,
node_comment_statistics.comment_count AS node_comment_statistics_comment_count,
- delete them manually
- use image_style_flush
- use the command line: rm -rf sites/default/files/styles
- use drush: drush image-flush
//Update google Analytics - client side
$window._gaq.push(['_trackPageview', $location.path()]);
//reload DFP banners
googletag.pubads().refresh();
git push origin master:gh-pages