Skip to content

Instantly share code, notes, and snippets.

View rakanalh's full-sized avatar

Rakan Al-Huneiti rakanalh

  • Open Source
  • Jordan
  • 23:36 (UTC +03:00)
  • X @rakanalh
View GitHub Profile
@magopian
magopian / fix_permissions.py
Created November 19, 2013 11:00
Django admin command to "fix permissions" (create them properly for proxy models). This is needed because of the following bug in Django (not fixed as of 1.6): https://code.djangoproject.com/ticket/11154
# -*- coding: utf-8 -*-
"""Add permissions for proxy model.
This is needed because of the bug https://code.djangoproject.com/ticket/11154
in Django (as of 1.6, it's not fixed).
When a permission is created for a proxy model, it actually creates if for it's
base model app_label (eg: for "article" instead of "about", for the About proxy
model).
@Jogan
Jogan / FloatingActionButton.java
Last active December 4, 2023 12:48
Implementation of Android L's floating action button pattern. API 14+
package your_package;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
@bsuh
bsuh / gist:bab7eeb8bda2421ac01c760c90668100
Last active September 17, 2017 16:58
emacs-25.1-rc1 24-bit color
diff --git a/lisp/term/tty-colors.el b/lisp/term/tty-colors.el
index 3ea26b8..c614825 100644
--- a/lisp/term/tty-colors.el
+++ b/lisp/term/tty-colors.el
@@ -1009,11 +1009,21 @@ tty-color-desc
Value is a list of the form (NAME INDEX R G B). The returned NAME or
RGB value may not be the same as the argument COLOR, because the latter
might need to be approximated if it is not supported directly."
+ ;; Here we are expeting to return (name idx (values)), be nice if we
+ ;; could just return the rgb, there is one use in
// Report on "stuck" ether in empty contracts
// https://github.com/ethereum/EIPs/issues/156
// Usage: node find-stuck-ether.js [startBlock] [endBlock] > report.txt
let Eth = require('ethjs');
let eth = new Eth(new Eth.HttpProvider('http://localhost:8545'));
let ethutil = require('ethereumjs-util')
async function main() {