Skip to content

Instantly share code, notes, and snippets.

@wschwab
wschwab / eventFilterWithPagination.js
Created August 24, 2020 14:57
an attempt at implementing some kind of pagination to an Ethereum event filter
const eventFilterv5WithPagination = (contractAddress, erc20abi, _provider, numberOfResponses) => {
// creating the interface of the ABI
const iface = new ethers.utils.Interface(erc20abi.abi);
// intialize array for the logs
let logs = [];
// get latest block number
const latest = await provider.getBlockNumber();
// intialize a counter for which block we're scraping starting at the most recent block
let blockNumberIndex = latest;
@yowu
yowu / HttpProxy.go
Last active April 27, 2024 20:17
A simple HTTP proxy by Golang
package main
import (
"flag"
"io"
"log"
"net"
"net/http"
"strings"
)
@Wysie
Wysie / gist:03934b6a79a715772abd
Last active December 10, 2019 20:01
Upload to Amazon S3 Instead of Server for Sendy Email Image Uploads
//Using S3.php from https://github.com/tpyo/amazon-s3-php-class. Place it in includes/helpers
//Replaces Sendy's includes/create/upload.php
<?php
include('../functions.php');
include('../login/auth.php');
require_once('../helpers/S3.php');
//Init
$file = $_FILES['file']['tmp_name'];

Multiple PHP version under Ubuntu 14.04

Update your machine

apt-get update
apt-get upgrade

Install some dependencies

apt-get install build-essential

@perminder-klair
perminder-klair / PushServer.php
Created June 24, 2014 09:53
Simple Apple and Google apps push PHP Server.
<?php
/**
* Usage:
* $message = 'My First Push Notification!';
* $pushServer = new PushSerer();
* $pushServer->pushToGoogle('REG-ID-HERE', $message);
* $pushServer->pushToApple('DEVICE-TOKEN-HERE', $message);
*/
class PushServer
@gionn
gionn / gist:4739763
Last active May 21, 2019 21:27
Zimbra: automatic fetching of external accounts.

Zimbra automatic fetching of external accounts

Zimbra 8 will not fetch automatically external POP3 or IMAP account. Use the following command to enable it! (every 5 minutes)

zmprov mc default zimbraDataSourcePollingInterval 5m

Top 100 PHP libraries from packagist

  1. twig/twig - Twig, the flexible, fast, and secure template language for PHP - 279287
  2. symfony/symfony - The Symfony PHP framework - 230662
  3. doctrine/common - Common Library for Doctrine projects - 230352
  4. doctrine/dbal - Database Abstraction Layer - 217097
  5. monolog/monolog - Logging for PHP 5.3 - 197983
  6. doctrine/orm - Object-Relational-Mapper for PHP - 196816
  7. swiftmailer/swiftmailer - Swiftmailer, free feature-rich PHP mailer - 172086
  8. kriswallsmith/assetic - Asset Management for PHP - 165852
  9. [sensio/distribution-bundle](https://packagist.org/packages/sen
@ikbear
ikbear / sortmap.go
Created November 8, 2012 12:59
Sort Map(golang)
package main
// sort a map's keys in descending order of its values.
import "sort"
type sortedMap struct {
m map[string]int
s []string
}
@rnapier
rnapier / fix-xcode
Last active March 18, 2022 01:17
Links Xcode SDKs from the /SDKs directory (which you maintain yourself)
#!/usr/bin/python
# fix-xcode
# Rob Napier <robnapier@gmail.com>
# Script to link in all your old SDKs every time you upgrade Xcode
# Create a directory called /SDKs (or modify source_path).
# Under it, put all the platform directories:
# MacOSX.platform iPhoneOS.platform iPhoneSimulator.platform
# Under those, store the SDKs:
@adammw
adammw / README.md
Created August 3, 2012 06:30
Node.js for Raspberry Pi

Node.js for Raspberry Pi

Pre-built binaries

Recent releases have been pre-built using cross-compilers and this script and are downloadable below.

If you have found these packages useful, give me a shout out on twitter: @adammw