Skip to content

Instantly share code, notes, and snippets.

Toshakins

Block or report user

Report or block Toshakins

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Toshakins
Toshakins / serializers.py
Created Mar 19, 2019
DRF Nested Multipart Example
View serializers.py
class NestedSerializer(Serializer):
name = CharField()
...
class UserSerializer(Serializer):
user = JSONField(validators=nested_validator)
...
def nested_validator(value):
serializer = NestedSerializer(data=value)
@Toshakins
Toshakins / scratch.rb
Last active Dec 27, 2018
Method Mapping Demo
View scratch.rb
class Actions
def action_a
puts 'A'
end
def action_b
puts 'B'
end
def action_c
View wishlist.md
@Toshakins
Toshakins / Code.gs
Created Dec 1, 2017
Spreadsheet notifications
View Code.gs
function sendEmails() {
var sheet = SpreadsheetApp.getActiveSheet();
var startRow = 2; // First row of data to process
var numRows = 50; // Number of rows to process
// Fetch the range of cells A2:B50
var dataRange = sheet.getRange(startRow, 1, numRows, 2)
// Fetch values for each row in the Range.
var data = dataRange.getValues();
for (i in data) {
var row = data[i];
View My Schedule
Schedule
10:00 Stage A
WebVR - The Next Frontier (ENG)
Martin Splitt
11:00 Stage B
Machines Must Suffer (RUS)
Oleksandr Pavlyshch
View README.MD
  • All inputs should be accessible via keyboard
  • Form should be accessible without javascript
  • Form should be submitted on 'Enter' hit in a text field.
@Toshakins
Toshakins / firewall.sh
Last active May 4, 2017
Redirect ports on OS X El Capitan via embedded firewall
View firewall.sh
#!/bin/bash
echo "
rdr pass inet proto tcp from any to any port 443 -> 127.0.0.1 port 4443
" | sudo pfctl -ef -
@Toshakins
Toshakins / README.md
Created Nov 14, 2016
extremewindsorderok
View README.md

README is empty

View gist:4c67b1012f584b8decea
CXX/LD -o .build_release/test/test_all.testbin src/caffe/test/test_caffe_main.cpp
.build_release/tools/caffe
caffe: command line brew
usage: caffe <command> <args>
commands:
train train or finetune a model
test score a model
device_query show GPU diagnostic information
time benchmark model execution time
View music.js
return function (t) {
return (70*base() + sin(0.5 * t % 0.2)*60) / 40 + sin(300) * 10
function tan(x) {
return Math.tan(Math.PI * t * x);
}
function sin(x) {
return Math.sin(Math.PI * t * x);
You can’t perform that action at this time.