Skip to content

Instantly share code, notes, and snippets.

Edmond Mensah EDDYMENS

Block or report user

Report or block EDDYMENS

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
@EDDYMENS
EDDYMENS / countries.json
Created Jun 22, 2019
List of countries with their currencies and codes details in JSON
View countries.json
[
{
"COUNTRY": "AFGHANISTAN",
"COUNTRY_CODE": "AFG",
"CURRENCY_CODE": "AFA",
"NAME_OF_CURRENCY": "Afghani"
},
{
"COUNTRY": "ALBANIA",
@EDDYMENS
EDDYMENS / pusher.php
Last active Apr 24, 2019
Single file (pusher.com) PHP SDK
View pusher.php
<?php
function push(string $region, string $app_id, string $app_key, string $app_secret, string $channel, string $event, string $data) {
$postData = json_encode(['data'=>$data, 'name'=>$event, 'channel'=>$channel]);
$md5_string = md5($postData);
$timestamp = strtotime('now +5 minutes');
$auth_signature = hash_hmac('sha256', "POST\n/apps/$app_id/events\nauth_key=$app_key&auth_timestamp=$timestamp&auth_version=1.0&body_md5=$md5_string", $app_secret);
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "http://api-$region.pusher.com/apps/$app_id/events?body_md5=$md5_string&auth_version=1.0&auth_key=$app_key&auth_timestamp=$timestamp&auth_signature=$auth_signature&",
CURLOPT_RETURNTRANSFER => true,
View screendy-insta-node.js
var App = {};
/**
@author Devless
@version 1
@description Devless sdk for Javascript
*/
/* Initizialize library */
(function (global /*this will contain the global window object*/) {
"use strict";
View screendy-insta.html
<h1>What Yee seeks may be found in the console :) => </h1>
<script>
(function(l){function h(a,b,c,d,e){e=e||!1;var f=new XMLHttpRequest;f.addEventListener("readystatechange",function(){var a="";4===this.readyState&&0==e?200==this.status?(a=JSON.parse(this.responseText),d(a)):(d(a),console.error("Devless cannot be found at "+this.devless_instance_url+" Please copy the url from the `App tab` on you Devless instance by clicking on `connect to my app`")):4===this.readyState&&1==e&&(200==this.status?(a=this.responseText,d(a)):(d(a),console.error("Devless cannot be found at "+
this.devless_instance_url+" Please copy the url from the `App tab` on you Devless instance by clicking on `connect to my app`")))});f.open(c.toUpperCase(),this.devless_instance_url+b);f.setRequestHeader("content-type","application/json");f.setRequestHeader("devless-token",this.devless_token);""!=localStorage.getItem("devless_user_token"+this.devless_instance_url+this.devless_token)&&f.setRequestHeader("devless-user-token",localStorag
@EDDYMENS
EDDYMENS / string.rb
Last active Oct 24, 2017
Experimenting with DSLs in Ruby . This time trying to get closer to English as possible
View string.rb
String.new("edmond"). convert_to_upper_case. then. reverse_the_string. lastly. display_to_screen
class String
def initialize(string)
@@string = string
end
def convert_to_upper_case()
@@string = @@string.upcase()
@EDDYMENS
EDDYMENS / notify.html
Last active Oct 31, 2016
Cool easy way to add pop up flash notification to web frontend with nothing more than bootstrap.
View notify.html
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div class="modal fade" id="notif" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog" style="width:250px;height:3%;">
<div class="modal-content" style="background-color:#7BE454;">
<div class="modal-body">
<div id="left">
<div>
You can’t perform that action at this time.