Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8" /> | |
<link type="text/css" href="fliptrip.css" rel="stylesheet"> | |
<script src="https://unpkg.com/react@16/umd/react.development.js" crossorigin></script> | |
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js" crossorigin></script> | |
<!-- | |
<script src="https://unpkg.com/react@16/umd/react.production.min.js" crossorigin></script> | |
<script src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js" crossorigin></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8" /> | |
<style> | |
.board { | |
display: inline-block; | |
} | |
.stone-wrapper { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def f(x) | |
x + 3 | |
end | |
def g(x) | |
x * x | |
end | |
def h(x) | |
2 * x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
package main | |
import ( | |
"fmt" | |
"math/rand" | |
) | |
func worker(n int, ch chan int) { | |
count := 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<link href="https://cdnjs.cloudflare.com/ajax/libs/vis/4.21.0/vis.min.css" rel="stylesheet"> | |
<style type="text/css"> | |
#network { | |
width: 400px; | |
height: 400px; | |
border: 1px solid #000; | |
} | |
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
import numpy | |
from deap import algorithms | |
from deap import base | |
from deap import creator | |
from deap import tools | |
creator.create("FitnessMax", base.Fitness, weights=(1.0,)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> from polls.models import Question, Choice | |
>>> from django.utils import timezone | |
>>> question = Question(question_text="What's new?", pub_date=timezone.now()) | |
>>> question.save() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.configuration.database_configuration[Rails.env]['adapter'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage: create_db_seed(Person) => "Person.first_or_create([{name: \"Jon\",age:23},{name: \"Mary\",age:31}])" | |
def create_db_seed(model) | |
records = model.all.map {|r| | |
attrs = r.attributes.map {|k,v| | |
next if /^id|created_at|updated_at$/ =~ k | |
"#{k}: #{v.inspect}" | |
}.compact.join(',') | |
"{#{attrs}}" | |
}.join(",\n") |
NewerOlder