Skip to content

Instantly share code, notes, and snippets.

View SamMousa's full-sized avatar
🎯
Focusing

Sam SamMousa

🎯
Focusing
  • Sam-IT
  • Netherlands
View GitHub Profile
@SamMousa
SamMousa / Secret.php
Last active November 15, 2017 11:21
Secure? secret storage.
<?php
namespace SamIT\Yii2;
class Secret
{
private $secret;
private $key;
<!DOCTYPE html>
<html lang="en">
<head>
<script type="text/javascript" src="https://code.jquery.com/jquery-2.2.4.js"></script>
<meta charset="UTF-8">
<title>Title</title>
</head>
<template id="mc">
@SamMousa
SamMousa / draytest.py
Last active February 21, 2016 22:05 — forked from doobeh/draytest.py
Testing Draytek Vodaphone for Home Automation.
import re
import requests
from collections import namedtuple
import urllib
import base64
# Change these to match your settings. I think the username/password
# is encoded, if it doesn't work, try changing `ENCODE_LOGIN` to False
# and see if it works better
@SamMousa
SamMousa / test
Created January 7, 2016 09:26
Verifying that +sammousa is my blockchain ID. https://onename.com/sammousa
test
<?php
namespace prime\commands;
use prime\models\User;
use yii\console\Controller;
use yii\db\ActiveRecord;
use yii\helpers\ArrayHelper;
<?php
use \yiiunit\data\ar\Customer;
// This enables calling the benchmark from a symlink.
chdir(dirname(($_SERVER['SCRIPT_FILENAME'][0] == '/' ? '': getcwd() . '/') . $_SERVER['SCRIPT_FILENAME']));
include dirname(($_SERVER['SCRIPT_FILENAME'][0] == '/' ? '': getcwd() . '/') . $_SERVER['SCRIPT_FILENAME']) . '/tests/bootstrap.php';
$test = new \yiiunit\framework\db\ActiveRecordTest();
$config = $test->getParam('databases')['mysql'];
unset($config['fixture']);
$('<input name="avg-browser-dev-iq" value="60" type="password" style="display: none;"/>').prependTo('form[autocomplete=off]input[type=password], input[type=password][autocomplete=off]');
setTimeout(function() {
$('input[name=avg-browser-dev-iq]').prop('disabled', true);
}, 15);