Skip to content

Instantly share code, notes, and snippets.

View neodaoist's full-sized avatar
💙
building

neodaoist neodaoist

💙
building
View GitHub Profile
@0x-stan
0x-stan / BAMM.py
Last active December 17, 2023 17:26
a demo of BAMM
"""
This is a demo of BAMM. Frax's recent article introduced BAMM, which is quite intriguing.
As the article didn't provide more details, I wanted to create a simple model for better understanding and simulation.
This includes some of my personal speculations on implementation details.
If there are any inaccuracies, feel free to point them out!
original article link: <https://flywheeldefi.com/article/bamm-revolutionary-primative>
"""
@devtooligan
devtooligan / return a string the Seaport way
Last active June 10, 2023 17:01
Returning a string in Huff, the "Seaport" way
Goal:
0x00: 0000000000000000000000000000000000000000000000000000000000000020 (offset)
0x20: 0000000000000000000000000000000000000000000000000000000000000003 (length)
0x40: 544b4e0000000000000000000000000000000000000000000000000000000000 (“TKN”)
Normal way:
Step 1)
0x20 0x00 MSTORE
Memory layout:
@lukas-h
lukas-h / license-badges.md
Last active April 20, 2025 12:09
Markdown License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.

Notes

  • The badges do not fully replace the license informations for your projects, they are only emblems for the README, that the user can see the License at first glance.

Translations: (No guarantee that the translations are up-to-date)

@dnegstad
dnegstad / initializer
Created December 9, 2014 03:07
Keeping link-to from blowing up with webcomponent.js polyfills
import Ember from 'ember';
Ember.LinkView.reopen({
layoutName: 'components/link-view'
});
export default {
name: 'link-to',
initialize: function() {}
};
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
var pickFiles = require('broccoli-static-compiler');
var mergeTrees = require('broccoli-merge-trees');
var vulcanize = require('broccoli-vulcanize');
var app = new EmberApp();
var polymerVulcanize = vulcanize('app', {
input: 'elements.html',
output: 'assets/vulcanized.html',
@dnegstad
dnegstad / Brocfile.js
Last active January 2, 2019 17:50
Polymer WebComponents in ember-cli >= 0.0.41
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
var pickFiles = require('broccoli-static-compiler');
var mergeTrees = require('broccoli-merge-trees');
var vulcanize = require('broccoli-vulcanize');
var app = new EmberApp();
var polymerVulcanize = vulcanize('app', {
input: 'elements.html',
output: 'assets/vulcanized.html',
@dmarcato
dmarcato / strip_play_services.gradle
Last active December 21, 2022 10:10
Gradle task to strip unused packages on Google Play Services library
def toCamelCase(String string) {
String result = ""
string.findAll("[^\\W]+") { String word ->
result += word.capitalize()
}
return result
}
afterEvaluate { project ->
Configuration runtimeConfiguration = project.configurations.getByName('compile')
@broady
broady / 1MarkerAnimation.java
Last active August 19, 2024 12:30
Animating Markers
/* Copyright 2013 Google Inc.
Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0.html */
package com.example.latlnginterpolation;
import android.animation.ObjectAnimator;
import android.animation.TypeEvaluator;
import android.animation.ValueAnimator;
import android.annotation.TargetApi;
import android.os.Build;
require 'rubygems'
require 'mechanize'
FIRST_NAME = 'FIRST_NAME'
LAST_NAME = 'LAST_NAME'
PHONE = 'PHONE'
EMAIL = '[email protected]'
PARTY_SIZE = 2
SCHEDULE_RANGE = { :start_time => '19:00', :end_time => '20:30' }
@JakeWharton
JakeWharton / dex.sh
Last active March 25, 2024 13:54
`classes.dex` method count helpers. Requires smali/baksmali from https://code.google.com/p/smali/ and dexdump from the build-tools in the Android SDK be on your PATH.
function dex-method-count() {
cat $1 | head -c 92 | tail -c 4 | hexdump -e '1/4 "%d\n"'
}
function dex-method-count-by-package() {
dir=$(mktemp -d -t dex)
baksmali $1 -o $dir
for pkg in `find $dir/* -type d`; do
smali $pkg -o $pkg/classes.dex
count=$(dex-method-count $pkg/classes.dex)
name=$(echo ${pkg:(${#dir} + 1)} | tr '/' '.')