Skip to content

Instantly share code, notes, and snippets.

@beautyfree
beautyfree / snippets.js
Last active December 14, 2022 11:49
Solana Web3 Snippets
import {
Account,
clusterApiUrl,
Connection,
PublicKey,
sendAndConfirmTransaction,
SystemProgram,
Transaction,
} from '@solana/web3.js';
@edsu
edsu / replies.py
Last active December 7, 2022 18:59
Try to get replies to a particular set of tweets, recursively.
#!/usr/bin/env python
"""
Twitter's API doesn't allow you to get replies to a particular tweet. Strange
but true. But you can use Twitter's Search API to search for tweets that are
directed at a particular user, and then search through the results to see if
any are replies to a given tweet. You probably are also interested in the
replies to any replies as well, so the process is recursive. The big caveat
here is that the search API only returns results for the last 7 days. So
@justvitalius
justvitalius / nonbounce.js
Last active December 26, 2015 11:19
turn off mobile webkit bounce effect on iPad & iphone
(function($){
"use strict";
var startY;
var defaults = {
"$these": [],
"touchstartInit": false,
"touchmoveInit": false
};
@BloodAxe
BloodAxe / setup.sh
Last active January 3, 2018 15:59
Configure DigitalOcean Droplet for cloud image processing
# Prepare system
apt-get update
apt-get upgrade
apt-get install build-essential
apt-get install cmake
apt-get install git
apt-get install pkg-config
# Grab frest opencv library
curl -sL https://github.com/Itseez/opencv/archive/master.zip > opencv.zip
@bioform
bioform / migrations.js
Created March 19, 2013 16:37
Rails like migrations for CompoundJS. Put this code to "/config/initializers/migrations.js"
var migrate = require('migrate')
, join = require('path').join
, fs = require('fs');
module.exports = function(compound) {
var app = compound.app;
var options = {args: []};
/**
* Migration template.