Tutorial by Examples

# Deny access to a directory from the IP 255.0.0.0 <Directory /path/to/directory> order allow,deny deny from 255.0.0.0 allow from all </Directory> # Deny access to a file from the IP 255.0.0.0 <FilesMatch "^\.ht"> order allow,deny deny fro...
python-social-auth is a framework that simplifies the social authentication and authorization mechanism. It contains many social backends (Facebook, Twitter, Github, LinkedIn, etc.) INSTALL First we need to install the python-social-auth package with pip install python-social-auth or download ...
Synopsis A fully functional demo of Firebase v3 Web authentication viewable here. Sign in with Facebook, Github, Google, Twitter, password based, and anonymous accounts. The code, available on Github, is easy to read and follow and is well documented. The focus is on the fully functional authent...
Here is a quick reference for advanced insertion, formatting, and filtering commands/shortcuts. Command/ShortcutResultg + ? + mPerform rot13 encoding, on movement mn + ctrl + a+n to number under cursorn + ctrl + x-n to number under cursorg + q+ mFormat lines of movement m to fixed width:rce wCenter...
When your app crashes, Xcode will enter the debugger and show you more information about the crash: The most important parts are: The red arrow The red arrow displays which line of code crashed & why it crashed. The debugger console Many crashes log more information to the debugger consol...
A SIGABRT or an EXC_BAD_INSTRUCTION usually means the app crashed itself intentionally because some check failed. These should log a message to the debugger console with more information; check there for more information. Many SIGABRTs are caused by uncaught Objective-C exceptions. There are a lo...
EXC_BAD_ACCESS means the process tried to access memory in an invalid way, like dereferencing a NULL pointer or writing to read-only memory. This is the hardest kind of crash to debug, because it usually does not have an error message, and some crashes can be very difficult to reproduce and/or occu...
If you either have apps generated with pre-android support or just did that on purpose, you can always add android project to your app. $ react-native android This will generate android folder and index.android.js inside your app.
It is common for company to set up it's own nuget server for distribution of packages across different teams. Go to Solution Explorer and click Right Mouse button then choose Manage NuGet Packages for Solution In window that opens click on Settings Click on + in top right corner the...
A process can (try to) send a signal to any other process using the kill() function. To do so, the sending process needs to known the receiving process' PID. As, without introducing a race, a process can only be sure of its own PID (and the PIDs of its children) the most simple example to demonstra...
Given 2 lists var list1 = new List<string> { "a", "b", "c" }; var list2 = new List<string> { "1", "2", "3", "4" }; if you want to output all permutations you could use nested loops like var result = new List<s...
The following example shows how to set up Dependency Injection using Ninject as an IoC container. First add a CustomModule class to your WebJob project, and add any dependency bindings there. public class CustomModule : NinjectModule { public override void Load() { Bind<IMyI...
import pandas as pd import numpy as np import matplotlib.pyplot as plt # I want 7 days of 24 hours with 60 minutes each periods = 7 * 24 * 60 tidx = pd.date_range('2016-07-01', periods=periods, freq='T') # ^ ^ # | ...
Mixins are similar to defining and calling functions. Say, if we need to create a repetitive style, mixins are handy. Mixins may or may not take parameters. For e.g.: .default-round-borders { border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; } .round-b...
In Less, unlike Sass or Shell, the variables are declared by having names starting with a @ symbol. For example: @sky-blue: #87ceeb; body { background-color: @sky-blue; } The above example gives you: body { background-color: #87ceeb; } Here it explains how to declare a variable an...
Consider the following example: @sky-blue: #87ceeb; @dark-sky-blue: @sky-blue + #333; body { background-color: @dark-sky-blue; } The above example gives you: body { background-color: #baffff; } Here it explains how to declare a variable and also make operations on a particular va...
C++11 The std::is_same<T, T> type relation is used to compare two types. It will evaluate as boolean, true if the types are the same and false if otherwise. e.g. // Prints true on most x86 and x86_64 compilers. std::cout << std::is_same<int, int32_t>::value << "\n&qu...
C++11 There are a number of different type traits that compare more general types. Is Integral: Evaluates as true for all integer types int, char, long, unsigned int etc. std::cout << std::is_integral<int>::value << "\n"; // Prints true. std::cout << std::is_in...
C++11 Type properties compare the modifiers that can be placed upon different variables. The usefulness of these type traits is not always obvious. Note: The example below would only offer an improvement on a non-optimizing compiler. It is a simple a proof of concept, rather than complex example. ...
aiohttp provides asynchronous websockets. Python 3.x3.5 import asyncio from aiohttp import ClientSession with ClientSession() as session: async def hello_world(): websocket = await session.ws_connect("wss://echo.websocket.org") websocket.send_str("Hell...

Page 647 of 1336