Skip to content

Instantly share code, notes, and snippets.

View gleuch's full-sized avatar
🏃‍♂️
Marathon

Greg Leuch gleuch

🏃‍♂️
Marathon
View GitHub Profile
@botdad
botdad / CREATE07Proxy.sol
Created December 22, 2021 19:14
Proof of concept for rewritable data contracts
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.11;
import "./utils/Bytecode.sol";
contract CREATE07Proxy {
error ErrorDestroyingContract();
error ErrorDeployingToDeterministicAddress();
function deployDataContract(bytes memory data) external {
@antony
antony / bash.sh
Last active February 8, 2022 01:36
Auth0 SSR Compatible Integration with Sapper
npm install --save express express-openid-connect
@simov
simov / README.md
Last active October 8, 2024 11:55
Run `node` scripts using `nvm` and `crontab` without hardcoding the node version

Run node scripts using nvm and crontab without hardcoding the node version

cronjob.env.sh

#!/bin/bash

# NVM needs the ability to modify your current shell session's env vars,
# which is why it's a sourced function
const EthereumTx = require('ethereumjs-tx');
const _ = require('lodash');
class Wallet {
constructor(web3, address, privateKey) {
this.web3 = web3;
this.address = address;
this.privateKey = Buffer.from(privateKey, 'hex');
}
@mperham
mperham / convert.rake
Created March 15, 2012 17:44
Ruby script to update MySQL from Latin1 to UTF8 without data conversion
desc "convert a latin1 database with utf8 data into proper utf8"
task :convert_to_utf8 => :environment do
puts Time.now
dryrun = ENV['DOIT'] != '1'
conn = ActiveRecord::Base.connection
if dryrun
def conn.run_sql(sql)
puts(sql)
end
else
@iwinux
iwinux / gist:1529093
Created December 28, 2011 18:38
config.assets.precompile
def compile_asset?(path)
# ignores any filename that begins with '_' (e.g. sass partials)
# all other css/js/sass/image files are processed
if File.basename(path) =~ /^[^_].*\.\w+$/
puts "Compiling: #{path}"
true
else
puts "Ignoring: #{path}"
false
end
@Epictetus
Epictetus / gist:1031117
Created June 17, 2011 09:24 — forked from WizardOfOgz/gist:1012107
Save Base64-encoded images with Paperclip
class Avatar < ActiveRecord::Base
attr_accessor :content_type, :original_filename, :image_data
before_save :decode_base64_image
has_attached_file :image,
PAPERCLIP_CONFIG.merge(
:styles => {
:thumb => '32x32#',
:medium => '64x64#',
/*-------- Here's how your Gists render in #newtwitter's details pane --------*/
twttr.mediaType('twttr.media.types.Gist')
.url('http://gist.github.com')
.matcher(/\b(?:https?\:\/\/)?gist\.github\.com\/(\S+)/g)
.icon('generic')