A collection of seemingly helpful information.
This file contains hidden or 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
#!/usr/bin/osascript | |
# <swiftbar.hideAbout>true</swiftbar.hideAbout> | |
# <swiftbar.hideRunInTerminal>true</swiftbar.hideRunInTerminal> | |
# <swiftbar.hideLastUpdated>true</swiftbar.hideLastUpdated> | |
# <swiftbar.hideDisablePlugin>true</swiftbar.hideDisablePlugin> | |
# <swiftbar.hideSwiftBar>false</swiftbar.hideSwiftBar> | |
property btnTitle : "Mute audio" |
This file contains hidden or 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
.DS_Store |
This file contains hidden or 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 "typhoeus" | |
hydra = Typhoeus::Hydra.new | |
requests = 200.times.map { Typhoeus::Request.new('localhost:4567', method: :get, timeout: 5) } | |
requests << Typhoeus::Request.new('localhost:4567/timeout', method: :get, timeout: 5) | |
requests.each { |request| hydra.queue request } | |
hydra.run |
This file contains hidden or 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
Module Module1 | |
Sub Main() | |
EasyPost.Client.apiKey = "..." | |
Dim fromAddress As New EasyPost.Address | |
With fromAddress | |
.phone = "1234567890" | |
.name = "Andrew Tribone" | |
.email = "[email protected]" |
This file contains hidden or 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 Object | |
def self.init(*names) | |
define_method(:initialize) do |*args| | |
names.zip(args).each do |name, arg| | |
instance_variable_set("@#{name}", arg) | |
end | |
singleton_class.class_eval do | |
attr_reader *names | |
end |
This file contains hidden or 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 collections import namedtuple | |
from new import instancemethod | |
def to_object(name, dictionary, base_class=object, functions=None, properties=None): | |
functions = functions or {} | |
properties = properties or {} | |
class Object(base_class): |
This file contains hidden or 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 double(func): | |
def wrapped(*args, **kwargs): | |
return func(*args, **kwargs) * 2 | |
return wrapped | |
def increment(func): | |
def wrapped(*args, **kwargs): | |
return func(*args, **kwargs) + 1 | |
return wrapped |
This file contains hidden or 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 _property(attr): | |
def __get(self): | |
return getattr(self, attr) | |
def __set(self, value): | |
setattr(self, attr, value) | |
return property(__get, __set) |
This file contains hidden or 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
t = lambda x: (lambda a, b: a * b)(*x) | |
t((5, 2)) # 10 |
NewerOlder