Skip to content

Instantly share code, notes, and snippets.

View gamafranco's full-sized avatar

Tiago Franco gamafranco

View GitHub Profile
@Athiriyya
Athiriyya / parse_dfk_quest_results.py
Last active July 8, 2022 15:23
Python code to parse the results of a Defi Kingdoms quest
#! /usr/bin/env python
from copy import deepcopy
import logging
import sys
from web3 import Web3
from web3.logs import DISCARD
from dfktools.quests.quest_core_v1 import CONTRACT_ADDRESS as QUEST_V1_CONTRACT_ADDRESS
from dfktools.quests.quest_core_v1 import ABI as QUEST_V1_ABI
@davidcunha
davidcunha / data-structures-summary.md
Last active May 13, 2022 04:36
Data Structures Summary

General purposes data structures

Linked Lists

  • small amount of data, not predictable
  • used when data is frequently inserted and deleted
  • searching is slow
  • the insertion order matters when searching

Arrays

  • searching and deletion are slow
# functions and variables
unset $(set | awk -F"[= ]" '/^\w*(RUBY|GEM|IRB|rvm|gem|rubies)\w*(=| \(\))/ {print $1}')
# aliases
unalias $(alias | awk -F"[= ]" '/rvm/ {print $2}')
# others
unset cd file_exists_at_url popd pushd
# PATH
@ryenus
ryenus / rvm-unload.sh
Last active December 10, 2015 12:18
unload rvm
# functions and variables
unset $(set | awk -F"[= ]" '/^\w*(RUBY|GEM|IRB|rvm|gem|rubies)\w*(=| \(\))/ {print $1}')
# aliases
unalias $(alias | awk -F"[= ]" '/rvm/ {print $2}')
# others
unset cd file_exists_at_url popd pushd
# PATH
@jonathanmoore
jonathanmoore / gist:2640302
Created May 8, 2012 23:17
Get the share counts from various APIs

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

@rajraj
rajraj / es.sh
Created January 3, 2012 20:07 — forked from aaronshaf/es.sh
Install ElasticSearch on CentOS 6
cd ~
sudo yum update
sudo yum install java-1.7.0-openjdk.i686 -y
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.9.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
mv elasticsearch-* elasticsearch
sudo mv elasticsearch /usr/local/share
@ryanb
ryanb / rails_3_1_rc4_changes.md
Created May 6, 2011 01:10
The Changelogs for Rails 3.1 Beta 1

Railties 3.1 RC4

  • The new rake task assets:clean removes precompiled assets. [fxn]

  • Application and plugin generation run bundle install unless --skip-gemfile or --skip-bundle. [fxn]

  • Fixed database tasks for jdbc* adapters #jruby [Rashmi Yadav]

  • Template generation for jdbcpostgresql #jruby [Vishnu Atrai]