Skip to content

Instantly share code, notes, and snippets.

View enyachoke's full-sized avatar

Emmanuel Nyachoke enyachoke

View GitHub Profile
@pyrou
pyrou / docker-compose.yml
Last active May 2, 2024 11:09
Use https://traefik.me SSL certificates for local HTTPS without having to touch your /etc/hosts or your certificate CA.
version: '3'
services:
traefik:
restart: unless-stopped
image: traefik:v2.0.2
ports:
- "80:80"
- "443:443"
labels:
- "traefik.http.services.traefik.loadbalancer.server.port=8080"
@enyachoke
enyachoke / _form.php
Created September 14, 2012 11:15
A yii datepicker code
<div class="row">
<?php echo $form->labelEx($model,'End_date'); ?>
<?php $this->widget('zii.widgets.jui.CJuiDatePicker', array(
'model'=>$model, 'attribute'=>'End_date',
'options'=>array(
'dateFormat'=>'yy-mm-dd',
'yearRange'=>'-70:+0',
'changeYear'=>'true',
'changeMonth'=>'true',
),
@atrus6
atrus6 / Java Code.
Created July 21, 2012 04:34
How to create a puzzle using the puzzle library.
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
int[] mImageIds = { R.drawable.kitten1, R.drawable.kitten2,
R.drawable.kitten3, R.drawable.kitten4, R.drawable.kitten5,
R.drawable.kitten6, R.drawable.kitten7, R.drawable.kitten8,
R.drawable.kitten9, R.drawable.kitten10, R.drawable.kitten11,
R.drawable.kitten12, R.drawable.kitten13, R.drawable.kitten14,
R.drawable.kitten15, R.drawable.kitten16, R.drawable.kitten17,
R.drawable.kitten18, R.drawable.kitten19, R.drawable.kitten20,
@mbenedettini
mbenedettini / key_generation.py
Created November 30, 2011 15:56
Python implementation of Mifare AES-128 simmetric key diversification, as described in document AN10922
from Crypto.Cipher import AES
from bitstring import BitArray, Bits
(key, m) = (BitArray(hex='00112233445566778899AABBCCDDEEFF'), BitArray(hex='00000000000000000000000000000000'))
const_rb = BitArray(hex='00000000000000000000000000000087')
k0 = BitArray(hex=AES.new(key.bytes).encrypt(m.bytes).encode('hex'))