(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| #!/usr/bin/env python | |
| # encoding: utf-8 | |
| import MySQLdb | |
| from upsert import upsert | |
| db = MySQLdb.connect(host="localhost", user="root", passwd="", db="demo", charset="utf8") | |
| c = db.cursor() | |
| import warnings | |
| warnings.filterwarnings("ignore", "Unknown table.*") |
| // Add a 401 response interceptor | |
| window.axios.interceptors.response.use(function (response) { | |
| return response; | |
| }, function (error) { | |
| if (401 === error.response.status) { | |
| swal({ | |
| title: "Session Expired", | |
| text: "Your session has expired. Would you like to be redirected to the login page?", | |
| type: "warning", | |
| showCancelButton: true, |
| const dblTouchTapMaxDelay = 300 | |
| let latestTouchTap = { | |
| time: 0, | |
| target: null, | |
| } | |
| export default function isDblTouchTap(event) { | |
| const touchTap = { | |
| time: new Date().getTime(), | |
| target: event.currentTarget, |
| <?php namespace App\Providers; | |
| use Illuminate\Support\ServiceProvider; | |
| /** | |
| * If the incoming request is an OPTIONS request | |
| * we will register a handler for the requested route | |
| */ | |
| class CatchAllOptionsRequestsProvider extends ServiceProvider { |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| #!//opt/boxen/homebrew/bin/python | |
| import boto.sns | |
| import json | |
| REGION = 'us-west-2' | |
| TOPIC = '<ARN>' | |
| URL = '<Body of Message in this example I used a url>' |
| # In response to https://bitcointalk.org/index.php?topic=56424.msg1454348#msg1454348 | |
| # Highlights that json encoding of floats is no good | |
| # and that decimals can be used for encoding. | |
| import json | |
| from decimal import Decimal as D | |
| d1 = D(11) / D(10) # 1.1 | |
| d2 = D(22) / D(10) # 2.2 |
| <?php | |
| /* | |
| Copyright (c) 2013, Manu Manjunath | |
| All rights reserved. | |
| Redistribution and use of this program in source/binary forms, with or without modification are permitted. | |
| Link to this gist is preferred, but not a condition for redistribution/use. | |
| */ | |
| function parse_csv_file($csvfile) { |