A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.
One-line version to paste in your DevTools
Use $$ if your browser aliases it:
~ 108 byte version
| 'use strict'; | |
| var React = require('react-native'); | |
| var { | |
| Bundler, | |
| StyleSheet, | |
| Text, | |
| TouchableHighlight, | |
| View, | |
| ScrollView, |
| # Initialize the scroll | |
| page = es.search( | |
| index = 'yourIndex', | |
| doc_type = 'yourType', | |
| scroll = '2m', | |
| search_type = 'scan', | |
| size = 1000, | |
| body = { | |
| # Your query's body | |
| }) |
| /*global $,localStorage*/ | |
| $.fn.draft = function () { | |
| 'use strict'; | |
| if (!localStorage) { | |
| return; | |
| } | |
| var form = $(this), | |
| fields = form.find('input,select,textarea'), |
| void setup() { | |
| } | |
| void loop(){ | |
| unsigned int ir[] = {8576,4224,640,1664,640,640,640,640,640,640,640,1664,640,640,640,640,640,640,640,640,640,640, | |
| 640,640,640,640,640,640,640,1664,640,640,640,640,640,1664,640,640,640,640,640,640,640,640, | |
| 640,640,640,640,640,640,640,1664,640,1664,640,640,640,640,640}; | |
| send (ir, 59, 36000); | |
| } |
| #!/usr/bin/python | |
| # Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford ([email protected]) | |
| # The author disclaims copyright to this source code. | |
| import sys | |
| import struct | |
| import socket | |
| import time | |
| import select |
As of version 3.3, python includes the very promising concurrent.futures module, with elegant context managers for running tasks concurrently. Thanks to the simple and consistent interface you can use both threads and processes with minimal effort.
For most CPU bound tasks - anything that is heavy number crunching - you want your program to use all the CPUs in your PC. The simplest way to get a CPU bound task to run in parallel is to use the ProcessPoolExecutor, which will create enough sub-processes to keep all your CPUs busy.
We use the context manager thusly:
with concurrent.futures.ProcessPoolExecutor() as executor:| //----------------------------------------------- | |
| // SPARK CORE CUSTOM PWM FREQUENCY EXAMPLE | |
| //=============================================== | |
| // Define your own frequency below! | |
| // PWM Glitch issue fixed, only sets up PWM once, | |
| // ... thereafter sets duty cycle. | |
| // This allows true 0 - 100% PWM. | |
| // Copy this into a new application at: | |
| // https://www.spark.io/build and go nuts! | |
| //----------------------------------------------- |
| SQRT_5 = Math.sqrt(5) | |
| GOLDEN_NUMBER = (1+SQRT_5)/2 | |
| def fib(n) | |
| (1/SQRT_5*(GOLDEN_NUMBER**n-(-1/GOLDEN_NUMBER)**n)).to_i | |
| end | |
| puts fib(7) |
| from __future__ import print_function | |
| from collections import OrderedDict | |
| from prepareable import Prepareable | |
| from six import with_metaclass, iteritems | |
| class FooMeta(with_metaclass(Prepareable, type)): | |
| def __new__(cls, name, bases, attributes): |