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 'benchmark/ips' | |
require 'active_support/hash_with_indifferent_access' | |
require 'active_support/core_ext/hash' | |
class Hash | |
def except_new(*keys) | |
slice(*(self.keys - keys)) | |
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
CustomResponseHeader: | |
Type: AWS::Serverless::Function | |
Properties: | |
# FunctionName: !Sub ${AWS::StackName}-CustomResponseHeader | |
Handler: index.handler | |
Runtime: nodejs12.x | |
AutoPublishAlias: live | |
AssumeRolePolicyDocument: | |
Version: 2012-10-17 | |
Statement: |
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 ( | |
"strconv" | |
"github.com/brutella/hc" | |
"github.com/brutella/hc/log" | |
"github.com/brutella/hc/accessory" | |
) | |
type Bridge struct { |
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
telnet 127.0.0.1 1234 |
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
sudo ifconfig en1 ether 60:33:4b:0b:50:0e | |
ifconfig en1 | grep ether |
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
#!/bin/ruby | |
require "fileutils" | |
src = ARGV.first | |
dest = ARGV.last | |
Dir.chdir(src) do | |
src_dirs = Dir["**/*/"].select{|node| !File.file? node } | |
src_files = Dir["**/*"].select{|node| File.file? node } |
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
#!/bin/sh | |
# | |
# Lives in .git/hooks. | |
# To enable this hook, rename this file to "pre-commit". | |
# Redirect output to stderr. | |
exec 1>&2 | |
# works, but is slow. try with ack! | |
# LANG=C find . -name '*_spec.rb' | xargs egrep -q '^\s*(describe|it|context)\b.*focus' |
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 D | |
def macro | |
:referenced_in | |
end | |
def foreign_key | |
"listimage_asset_id" | |
end | |
def eager_load ids |
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> | |
<style> | |
body { | |
counter-reset: n; | |
} | |
div:before { | |
counter-increment: n; | |
content: counter(n); | |
} |
NewerOlder