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\/"}}
<?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:33c9f99f40fdc7179cfa
Created August 29, 2014 18:46
Barebones Grunt File
module.exports = function(grunt) {
grunt.initConfig({
concat: {
options: {
separator: '',
},
dist: {
src: ['../scripts/*.functions.js'],
dest: '../js/application.js',
},
@chrisjdavis
chrisjdavis / gist:8599255
Created January 24, 2014 15:19
New Features in Two 1.1
What's not new? Bug fixes, UI tweaks and new features oh my!
With this release we focused on adding features that our power users most requested!
* Convert your mobile view to a PNG and save it to your Desktop!
* Manage your breakpoints! Don't care about screens that are 360 pixels wide? Delete it!
* Custom User Agents! We have added the ability to set the user agent of the mobile view. You can also manage these via app Preferences!
@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];