A (more) complete cheatsheet for Arel, including NamedFunction functions, raw SQL and window functions.
posts = Arel::Table.new(:posts)
posts = Post.arel_table # ActiveRecord| ruby '2.7.1' | |
| gem 'rails', github: 'rails/rails' | |
| gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data | |
| # Action Text | |
| gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra' | |
| gem 'okra', github: 'basecamp/okra' | |
| # Drivers |
| SAN_CMP := -fno-omit-frame-pointer -fsanitize=address | |
| SAN_STAT := -static-libstdc++ -static-libasan | |
| BIN_CMP := -std=c++11 -c -I. main.cpp -O -g3 -o main.o | |
| LIB_CMP := -std=c++11 my.cpp -o libmy.so -shared -fPIC -g3 | |
| RUN := LD_LIBRARY_PATH=. ASAN_OPTIONS=symbolize=1 ASAN_SYMBOLIZER_PATH=$(shell which llvm-symbolizer) | |
| PRELOAD := LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libasan.so.1 | |
| lib-gcc: |
This is inspired by https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/
the command zig run my_code.zig will compile and immediately run your Zig
program. Each of these cells contains a zig program that you can try to run
(some of them contain compile-time errors that you can comment out to play
with)
I'm a huge fan of these kinds of noisy grid patterns, and I wanted to add some to my in-progress site. Rather than tinkering away in Figma, I thought I would make a little generator. I hope some other folks find it useful!
A Pen by George Francis on CodePen.
| import tensorflow as tf #We need tensorflow 2.x | |
| import numpy as np | |
| #The hashlength in bits | |
| hashLength = 256 | |
| def buildModel(): | |
| #we can set the seed to simulate the fact that this network is known and doesn't change between runs | |
| #tf.random.set_seed(42) | |
| model = tf.keras.Sequential() |
| // | |
| // Author: Jonathan Blow | |
| // Version: 1 | |
| // Date: 31 August, 2018 | |
| // | |
| // This code is released under the MIT license, which you can find at | |
| // | |
| // https://opensource.org/licenses/MIT | |
| // | |
| // |
| #!/bin/sh | |
| prog_name=${0##*/} | |
| version=1.0 | |
| version_text="Boilerplate for new scripts v$version" | |
| options="h o: q v V" | |
| help_text="Usage: $prog_name [-o <text>] [-hqvV] [<file>]... | |
| Boilerplate for new scripts |
initialize: once, when the controller is first instantiatedconnect: anytime the controller is connected to the DOM| package main | |
| import ( | |
| "crypto/rand" | |
| "crypto/rsa" | |
| "crypto/x509" | |
| "crypto/x509/pkix" | |
| "encoding/asn1" | |
| "encoding/pem" | |
| "os" |