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 sys | |
import os | |
import xml.etree.ElementTree as ET | |
import logging | |
import re | |
from shutil import copyfile | |
from optparse import OptionParser | |
### This file came from the https://github.com/flow123d/flow123d repo they were nice enough to spend time to write this. | |
### It is copied here for other people to use on its own. |
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
/** | |
* Can you explain the differences between all those ways | |
* of passing function to a component? | |
* | |
* What happens when you click each of the buttons? | |
*/ | |
class App extends React.Component { | |
constructor() { | |
super(); |
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
################## | |
function foo () { | |
console.log("Simple function call"); | |
console.log(this === window); | |
} | |
foo(); | |
console.log(this === window) | |
################## |
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 Cryptodome.Cipher import AES | |
KEY = '30c732878042aa2ea569efc1c42ab17d' | |
def gcm_decrypt(key, encrypted_data): | |
nonce, tag, ciphertext = encrypted_data[:16], encrypted_data[16:32], encrypted_data[32:] | |
cipher = AES.new(key, AES.MODE_GCM, nonce) | |
return cipher.decrypt_and_verify(ciphertext, tag) |
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
F(T|¬D) = P(¬D|T) * P(T) / P(¬D) | |
P(¬D|T) = P(¬D) ??? | |
F(T|¬D) = P(¬D) * P(T) / P(¬D) = P(T) = 0.99 ??? |
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 'rollbar' | |
require 'rollbar/delay/delayed_job' | |
require 'delayed/backend/active_record' | |
module Rollbar | |
MAX_TEXT_SIZE = 65_535 # Max size for text columns in MySQL | |
class DelayedHandlerTooLarge < StandardError | |
end | |
end |
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
IGNORED_IPS = [] | |
class Rollbar::Notifier | |
def report(*args) | |
return if ignore_request? | |
super(*args) | |
end | |
def ignore_request? |
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
# config/environment.rb | |
require File.expand_path('../application', __FILE__) | |
require File.expand_path('../rollbar', __FILE__) | |
begin | |
Rails.application.initialize! | |
rescue Exception => e | |
Rollbar.error(e) | |
raise |
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 'sinatra/base' | |
require 'rollbar' | |
require 'rollbar/middleware/sinatra' | |
Rollbar.configure do |config| | |
config.access_token = 'bfec94a1ede64984b862880224edd0ed' | |
config.enabled = true | |
end | |
class App < Sinatra::Base |
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
#include <assert.h> | |
#include <stdarg.h> | |
#include <stdbool.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
enum type { | |
NIL, |
NewerOlder