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
const SegfaultHandler = require('segfault-handler'); | |
SegfaultHandler.registerHandler('crash.log'); | |
const { PrismaClient } = require('@prisma/client'); | |
async function main() { | |
const prisma = new PrismaClient(); | |
const { id } = await prisma.notification.create({ data: { to: "[email protected]" } }); | |
console.log(id) | |
} |
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
# threads dying on fork examples. run with: | |
# ruby main.rb | |
# or | |
# ruby main.rb fork | |
# | |
require 'thread' | |
class Worker | |
def initialize | |
@thread = Thread.new { work } |
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
class Chromosome | |
SIZE = 10 | |
attr_reader :value | |
def initialize(value) | |
@value = value | |
end | |
def fitness |
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
require "ecr" | |
class Greeting | |
# def wrap(tag) | |
# String.build do |str| | |
# str << "<#{tag}>" | |
# str << yield | |
# str << "</#{tag}>" | |
# end | |
# end |
I hereby claim:
- I am felipeelias on github.
- I am felipeelias (https://keybase.io/felipeelias) on keybase.
- I have a public key ASCXvgXFgRDO3gzYvfR9Q2V2K9pra4RL5kv-r8M3EoKmfQo
To claim this, I am signing this object:
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
defmodule Pubsub do | |
use Application | |
def start(_type, _options) do | |
import Supervisor.Spec | |
IO.puts("Initializing Pubsub app on #{inspect self}") | |
children = [ | |
worker(Pubsub.Server, [], [name: :server_supervisor]) |
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" | |
"sync" | |
"time" | |
) | |
var wg sync.WaitGroup |
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
LaundryMachine washer = getLaundryMachine(); | |
washer.open(); | |
List<Unerdwear> pileOfUnerdwear = gatherUnerdwear(); | |
for (Unerdwear underwear : pileOfUnerdwear) { | |
if (underwear.isDirty() OR underwear.isSticky()) { | |
washer.load(underwear); | |
} else { | |
putOn(underwear); | |
while (undewear.isntDirty()) { |
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
RSpec.configure do |config| | |
config.around do |example| | |
# For examples using capybara-webkit for example. | |
# Remove this if you don't use it or anything similar | |
if example.metadata[:js] | |
example.run | |
ActiveRecord::Base.connection.execute("TRUNCATE #{ActiveRecord::Base.connection.tables.join(',')} RESTART IDENTITY") | |
else | |
ActiveRecord::Base.transaction do |
NewerOlder