Skip to content

Instantly share code, notes, and snippets.

View eezis's full-sized avatar

Ernest Ezis eezis

  • Boulder, CO
View GitHub Profile
@eezis
eezis / gist:eddd935a942f24936dcf41edf780be9b
Created October 21, 2016 19:54
Spread locust.io across cores using the multiprocessing library
import sys
import subprocess
import multiprocessing
# use htop to see the utilization rates spread across cores
# use locust --help to see all the options
# the cmd launches 500 concurrent users on each core, hatch 5 per second, issue 10k requests then stops
# logs to results.txt, prints the summary in the terminal
@eezis
eezis / elm extend sample
Last active May 17, 2016 03:36
messing around with elm -- take input, reverse it, upper case it, count chars, change color if length is even
{-
for v 0.17
http://guide.elm-lang.org/architecture/user_input/text_fields.html
1. reverse and uppercase input. Check
2. count & display the number of characters. Check
3. change text color if even number of characters . . . Check, but ugly.
-}
@eezis
eezis / elm button example extend
Last active May 16, 2016 22:19
elm button - 1
{-
Step 1, just trying to make the "-" button red. http://elm-lang.org/examples/buttons
-- import that Html.Attributes module
-- define the style
-- add the style attribute to the button
Step 2, How do I make the "-" button turn red on odd numbers, and green on even numbers?
-}
@eezis
eezis / elixir elm 0.17
Created May 15, 2016 00:50
app.js for elixir 1.2 and elm 0.17 (elm embedded in app.js)
// This works
var elmDiv = document.getElementById('elm-main')
, elmApp = Elm.WordGame.embed(elmDiv)
// but this works too. Why to both work, which is preferred?
var elmDiv = document.getElementById('elm-main')
Elm.WordGame.embed(elmDiv)
@eezis
eezis / etrecheck
Created May 6, 2016 23:02
EtreCheck
EtreCheck version: 2.9.12 (265)
Report generated 2016-05-06 16:55:34
Download EtreCheck from https://etrecheck.com
Runtime 1:36
Performance: Excellent
Click the [Support] links for help with non-Apple products.
Click the [Details] links for more information about that line.
Problem: Other problem
@eezis
eezis / crispy-forms-inlineradios.py
Created April 19, 2016 21:03
Horizontal Radio Buttons For Boolean Values Using Crispy Forms with Django
Quick guide to getting inlineradio buttons when using boolean values with Crispy Forms.
1. create chocies
BOOLEAN_YN = (
(True, u'Yes'),
(False, u'No'),
)
2. update model to point at the choices
@eezis
eezis / cfbundlerid
Created September 30, 2015 02:11
unable to match
To find the proper cfbundlerid when writing an appmethod or firemonkey delphi application, go to the tools/options/provisioning
Then select the build type and provisioning file, then the developer certificate.
That will show the "Applicateion Identifier" it will look like:
S3AB5SSYN.com.domain.appname
Put that in the CFBUNDLER in the project/option/versioninfo
@eezis
eezis / pdquestion
Last active August 29, 2015 14:12
phoenix docs question
Are templates scoped to a controller by naming convention? And is that convention two layers deep
and implemented with filenames?
First convention describes rules for a controller's filename; stipulating that Controller filenames
get two parts seperated by
an underscore. An application with these three controllers -- PageController, HelloController, and
UserController -- should manifest the following file names:
controllers
|- page_controller.ex
@eezis
eezis / hist command search
Last active October 1, 2015 08:56
Incremental Search History for the OS X Terminal (type a partial command, up arrow / down arrow to search)
@eezis
eezis / compile ecto
Created October 29, 2014 19:55
Elixir Does Pheonix Ecto Compilation Fix
10.29.14
I was following this tutorial: http://www.elixirdose.com/post/lets-build-web-app-with-phoenix-and-ecto
Could not mix compile
==> postgrex
warning: the dependency postgrex requires Elixir "0.15.0" but you are running on v1.0.1
Compiled lib/postgrex/binary_utils.ex
Compiled lib/postgrex/error.ex