by Ossi Hanhinen, @ohanhi
with the support of Futurice 💚.
Licensed under CC BY 4.0.
docker ps | awk {' print $1 '} | tail -n+2 > tmp.txt; for line in $(cat tmp.txt); do docker kill $line; done; rm tmp.txt |
import re | |
import uuid | |
import base64 | |
def uuid_url64(): | |
"""Returns a unique, 16 byte, URL safe ID by combining UUID and Base64 | |
""" | |
rv = base64.b64encode(uuid.uuid4().bytes).decode('utf-8') | |
return re.sub(r'[\=\+\/]', lambda m: {'+': '-', '/': '_', '=': ''}[m.group(0)], rv) |
// How to ensure that our animation loop ends on component unount | |
componentDidMount() { | |
this.startLoop(); | |
} | |
componentWillUnmount() { | |
this.stopLoop(); | |
} |
;; try this form-by-form at a REPL | |
(require '[clojure.spec.alpha :as s]) | |
;; create an inline DSL to describe the FizzBuzz world | |
(defmacro divides-by | |
[nm n] | |
`(s/def ~nm (s/and pos-int? #(zero? (mod % ~n))))) | |
;; specify FizzBuzz | |
(divides-by ::fizz 3) |
// Generate unique IDs for use as pseudo-private/protected names. | |
// Similar in concept to | |
// <http://wiki.ecmascript.org/doku.php?id=strawman:names>. | |
// | |
// The goals of this function are twofold: | |
// | |
// * Provide a way to generate a string guaranteed to be unique when compared | |
// to other strings generated by this function. | |
// * Make the string complex enough that it is highly unlikely to be | |
// accidentally duplicated by hand (this is key if you're using `ID` |
import React from 'react'; | |
import { Layer, Rect, Stage, Line, Circle, Group } from 'react-konva'; | |
import Konva from 'konva'; | |
import compose from 'recompose/compose'; | |
import { connect } from 'react-redux'; | |
import { addRectangle } from 'vclub/redux/club/whiteboard'; | |
const enhance = compose( |
<h1>JQUERY NUMBER ANIMATION</h1> | |
<h3>jQuery counter to count up to a target number</h3> | |
<div class="wrapper"> | |
<div class="counter col_fourth"> | |
<i class="fa fa-code fa-2x"></i> | |
<h2 class="timer count-title count-number" data-to="300" data-speed="1500"></h2> | |
<p class="count-text ">SomeText GoesHere</p> | |
</div> |
package recfun | |
import scala.collection.mutable.ListBuffer | |
import common._ | |
/** https://class.coursera.org/progfun-2012-001/assignment/view?assignment_id=4 */ | |
object Main { | |
def main(args: Array[String]) { | |
println("Pascal's Triangle") | |
for (row <- 0 to 10) { |