Skip to content

Instantly share code, notes, and snippets.

View newscloud's full-sized avatar

Jeff Reifman newscloud

View GitHub Profile
@newscloud
newscloud / keybase.md
Created March 27, 2015 22:56
My Keybase gist to verify my github account

Keybase proof

I hereby claim:

  • I am newscloud on github.
  • I am jeffreifman (https://keybase.io/jeffreifman) on keybase.
  • I have a public key whose fingerprint is 4D3E 6456 A60E 3C14 D960 3FE2 6011 E858 FC97 F62D

To claim this, I am signing this object:

wow
wow
wow
wow
wow
wow
wow
wow
@newscloud
newscloud / gist:8393857
Created January 13, 2014 02:33
Code to encrypt and store salted usernames and passwords in PHP using MCrypt from http://jeffreifman.com/filtered-open-source-imap-mail-filtering-software-for-php/
public function createCredentials($username,$password) {
$salt = $this->random_string(4,4).'::'.$this->random_string(4,4);
$salts = explode('::',$salt);
$str = $salts[0].'::'.$username.'::'.$password.'::'.$salts[1];
$td = mcrypt_module_open('tripledes', '', 'ecb', '');
$iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND);
$account_salt = Yii::app()->params['account_salt']; // stored in your ini file somewhere on your server
mcrypt_generic_init($td, $account_salt, $iv);
$encrypted_data = mcrypt_generic($td, $str);
mcrypt_generic_deinit($td);
@newscloud
newscloud / index.html
Created July 21, 2018 01:52
Multi-series charting demo from ProgammableWeb coinlayer cryptocurrency API introduction
<html lang="en">
<head>
<!-- replace mine with your insert your favorite jquery source -->
<script src="http://localhost:8888/mp/assets/c19d41b1/jquery.js"></script>
<!-- end note -->
<link href="https://stackpath.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://stackpath.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<style>