Skip to content

Instantly share code, notes, and snippets.

View James-Parsons's full-sized avatar

James Parsons James-Parsons

View GitHub Profile
@azenla
azenla / dart.md
Last active August 29, 2015 14:16
My arguments for why Dart is the way to go.

Dart

There is a lot of controversy surrounding Dart, and I feel like this should be cleared up. Here I will display my arguments for why Dart is the way to go and answer some false concerns about Dart.

The Dart VM is fast

Dart's Virtual Machine is one of the fastest VMs out there to this day, at least with a language that is as powerful as Dart. Here is why it is fast:

  • It's not a bytecode VM, it's a source-based VM. This means that the VM doesn't have code that doesn't pertain to the language of Dart. You might say: well how does Dart optimize? The answer: It's able to perform more optimizations because it is optimizing at runtime, where it has much more information about what is actually going on.
  • It has SIMD support. This allows Dart to run operations on data very quickly.
@ArtSabintsev
ArtSabintsev / viewFromBarButtonItem.m
Last active August 31, 2018 16:55
Accessing default view from a UIBarButtonItem
/*
UIBarButtonItem does not subclass UIView.
However, there is a way to access the UIBarButtonItem's default view without breaching
Apple's 'Do not use private APIs' rule.
That's because said view responds to KVO, such as changing the tint-color.
*/
/*
After setting your UIBarButton item inside the UINavigationBar object or UIToolBar object,
access your view in the following fashion:
@benplum
benplum / HTML5 Enabler
Created December 19, 2013 20:06
HTML5 Enabler
/* Pre-Define HTML5 Elements in IE */
(function(){ var els = "source|address|article|aside|audio|canvas|command|datalist|details|dialog|figure|figcaption|footer|header|hgroup|keygen|mark|meter|menu|nav|picture|progress|ruby|section|time|video".split('|'); for(var i = 0; i < els.length; i++) { document.createElement(els[i]); } } )();
@arq5x
arq5x / test.sh
Last active November 30, 2023 12:50
Compress and then Decompress a string with zlib.
# compile
$ g++ zlib-example.cpp -lz -o zlib-example
# run
$ ./zlib-example
Uncompressed size is: 36
Uncompressed string is: Hello Hello Hello Hello Hello Hello!
----------
@lrvick
lrvick / flask_geventwebsocket_example.py
Created September 1, 2011 07:17
Simple Websocket echo client/server with Flask and gevent / gevent-websocket
from geventwebsocket.handler import WebSocketHandler
from gevent.pywsgi import WSGIServer
from flask import Flask, request, render_template
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')