Skip to content

Instantly share code, notes, and snippets.

@chrisjdavis
chrisjdavis / services.json
Last active May 29, 2021 21:18
list of services for my simple links builder
{"facebook":{"pattern":"fb:\/\/profile\/","url":"https:\/\/facebook.com"},"twitter":{"pattern":"twitter:\/\/user?screen_name=","url":"https:\/\/twitter.com"},"pintrest":{"pattern":"pinterest:\/\/user\/","url":"https:\/\/pinterest.com"},"instagram":{"pattern":"instagram:\/\/user?username=","url":"https:\/\/instagram.com"},"youtube":{"pattern":"vnd.youtube:\/\/","url":"https:\/\/youtube.com"},"yelp":{"pattern":"yelp:\/\/\/biz\/","url":"https:\/\/yelp.com\/user_details?userid="},"linkedin":{"pattern":"linkedin:\/\/profile?id=","url":"https:\/\/linkedin.com\/in\/"},"snapchat":{"pattern":"snapchat:\/\/add\/","url":"https:\/\/story.snapchat.com\/u\/"},"tiktok":{"pattern":"tsnssdk1233:\/\/profile\/","url":"https:\/\/www.tiktok.com\/"}}
@chrisjdavis
chrisjdavis / nuts.txt
Created January 20, 2012 16:41
This is nuts
<script type="text/javascript" src="chrome-extension://bfbmjmiodbnnpllbbbfblcplfjjepjdn/js/injected.js"></script></head><style type="text/css" style="display: none !important; ">/*This block of style rules is inserted by AdBlock*/#FFN_Banner_Holder,#FFN_imBox_Container,#RadAd_Skyscraper,#ab_pointer,#adxLeaderboard,#bbccom_leaderboard,#center_banner,#dir_ads_site,#flashad,#footer_adcode,#hbBHeaderSpon,#hiddenHeaderSpon,#navbar_adcode,#p360-format-box,#rightAds,#rightcolumn_adcode,#rm_container,#tads table[align="center"][width="100%"],#tooltipbox[class^="itxt"],#top-advertising,#topMPU,#tracker_advertorial,#ve_threesixty_swf[name="ve_threesixty_swf"],.ad-now,.ad_marquee,.dfpad,.kLink span[id^="preLoadWrap"].preLoadWrap,.prWrap,[id^="ad_block"],[id^="adbrite"],[id^="dclkAds"],[id^="ew"][id$="_bannerDiv"],[id^="konaLayer"],[src*="sixsigmatraffic.com"],a[href^="http://ad."][href*=".doubleclick.net/"],a[href^="http://adserver.adpredictive.com"],div[class^="dms_ad_IDS"],div[id^="adKontekst_"],div[id^="google_ads_di
<?php
class EasyLASTFM
{
const ENDPOINT = 'http://ws.audioscrobbler.com/2.0/';
const URL = 'https://www.last.fm/music/';
const API_KEY = '';
const CACHETIME = '86400'; // 24 hours in seconds
private function create_dir($path) {
<?php
class EasyLASTFM
{
const ENDPOINT = 'http://ws.audioscrobbler.com/2.0/';
const URL = 'https://www.last.fm/music/';
const API_KEY = '';
const CACHE = '86400'; // 24 hours in seconds
private function create_dir($path) {
@chrisjdavis
chrisjdavis / error message.txt
Created November 19, 2018 18:19
error message contents
error 2018-11-19T18:18:32.528 thread-0 wasm_interface.cpp:933 eosio_assert ] message: read
error 2018-11-19T18:18:32.528 thread-0 http_plugin.cpp:580 handle_exception ] FC Exception encountered while processing chain.push_transaction
debug 2018-11-19T18:18:32.528 thread-0 http_plugin.cpp:581 handle_exception ] Exception Details: 3050003 eosio_assert_message_exception: eosio_assert_message assertion failure
assertion failure with message: read
{"s":"read"}
thread-0 wasm_interface.cpp:934 eosio_assert
pending console output:
{"console":""}
thread-0 apply_context.cpp:72 exec_one
@chrisjdavis
chrisjdavis / create_account.php
Last active November 14, 2018 19:10
Full method, for context
public function create_account($vars, $type) {
$api = ( new \BlockMatrix\EosRpc\ChainFactory )->api();
$walapi = ( new \BlockMatrix\EosRpc\WalletFactory )->api();
$eos = ( new \BlockMatrix\EosRpc\EosRpc( $api, $walapi) );
$walapi->unlock( [self::WALLET_NAME, self::WALLET_PASS] );
$eos->setWalletInfo( self::WALLET_NAME, self::WALLET_PASS );
switch( $type ) {
case self::USER_TYPE_ACCOUNT :
@chrisjdavis
chrisjdavis / example.php
Created November 14, 2018 18:55
Example payload
$args = [
[
'account' => 'eosio',
'name' => 'newaccount',
'authorization' => [['actor' => 'eosio', 'permission' => 'active']],
'data' => [
'creator' => 'eosio',
'name' => $account_n,
'owner' => [
'threshold' => 1,
@chrisjdavis
chrisjdavis / gist:4046787
Created November 9, 2012 16:48
Passbook server API
<?php
class PassAPI extends Plugin
{
# Registration
# register a device to receive push notifications for a pass
#
# POST /v1/devices/<deviceID>/registrations/<typeID>/<serial#>
# Header: Authorization: ApplePass <authenticationToken>
# JSON payload: { "pushToken" : <push token, which the server needs to send push notifications to this device> }
#
@chrisjdavis
chrisjdavis / offscreen.m
Last active November 30, 2016 04:48
Creating windows offscreen for fun and profit.
- (IBAction)getImageFromWeb:(id)sender {
// grab the width and height of the document in our mobileView.
CGSize contentSize = CGSizeMake(
[[mobileView stringByEvaluatingJavaScriptFromString:@"document.body.scrollWidth;"] floatValue],
[[mobileView stringByEvaluatingJavaScriptFromString:@"document.body.scrollHeight;"] floatValue]
);
// create a new window, offscreen.
NSWindow *hiddenWindow = [[NSWindow alloc] initWithContentRect: NSMakeRect( -1000,-1000, contentSize.width, contentSize.height )
styleMask: NSTitledWindowMask | NSClosableWindowMask backing:NSBackingStoreNonretained defer:NO];