Instantly share code, notes, and snippets.

View python-essentials-0219.py
print(str(87))
print(str(87.0))
print(str(True))
print(str(False))
View mjs_docs_01.js
const Micro = require('./micro')
const app = new Micro({
env: 'prod',
templates: './templates',
port: 3535
})
app.router.all('/', (req, res) => {
res.end('Micro ...')
View playground.rs
fn main() {
println!("foo\
bar")
}
View OnSendMessage.js
onSendMessage = (content, type) => {
if (this.state.isShowSticker && type === 2) {
this.setState({ isShowSticker: false })
}
if (content.trim() === '') {
return
}
const timestamp = moment()
View Changed Paths
x86_64-linux tests.nixos-functions.nixos-test
View Makefile
server: ## Run an Apache server
@docker run -it --rm --name $(NAME) -p $(PORT):80 -e LOG_STDOUT=true -e LOG_STDERR=true -e LOG_LEVEL=debug -v $(pwd):/var/www/html fauria/lap
View ignore_warnings.py
# Ignore warnings
import warnings
warnings.filterwarnings("ignore")
View register.js
const axios = require('axios');
const AWS = require('aws-sdk');
const region = 'eu-west-1'; // REGION SHOULD BE LIKE (eu-west-1)
const dynamodb = new AWS.DynamoDB({ region: region, apiVersion: '2012-08-10' });
exports.handler = async ({body}) => {
const {data} = await axios.post("https://847some2lk.execute-api.eu-west-1.amazonaws.com/live/register", body);
const item = {
View Symbol.iterator
Number = new Proxy(Number, {
construct(target, args){
let index = 0
return {
[Symbol.iterator]() {
return this;
},
next(){
let value = args[0].toString()
if(index < value.length){
View capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')