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 'dart:math' show sqrt, max; | |
import 'dart:ui' show lerpDouble; | |
import 'package:flutter/material.dart'; | |
@immutable | |
class CircularRevealClipper extends CustomClipper<Path> { | |
final double fraction; | |
final Alignment centerAlignment; | |
final Offset centerOffset; |
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
<? | |
// | |
// [ BUY BTC & ETH DAILY ON BITSTAMP ] | |
// by @levelsio | |
// | |
// 2017-08-23 | |
// | |
// 1) buy $40/day BTC | |
// 2) buy $10/day ETH | |
// |
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
post_process { | |
soffice = '/Applications/LibreOffice.app/Contents/MacOS/soffice' | |
[file, country_report_file, total_report_file].each do |f| | |
system! "#{soffice} --headless --convert-to xlsx #{f}" | |
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
class X.Example extends X.Object | |
@proxyMethod "attachmentManager.manageAttachment" | |
# Equivalent to: | |
# manageAttachment: -> | |
# @attachmentManager.manageAttachment.apply(@attachmentManager, arguments) | |
@proxyMethod "delegate?.compositionDidChangeDocument" | |
# Equivalent to: | |
# compositionDidChangeDocument: -> | |
# @delegate?.compositionDidChangeDocument?.apply(@delegate, arguments) |
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
# encoding: UTF-8 | |
require 'optparse' | |
require 'net/http' | |
require 'json' | |
def parse_options(argv) | |
opts = {} | |
@parser = OptionParser.new do |o| |
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
# create an index with some state (in this case, a mapping) | |
curl -X POST localhost:9200/test-original -d '{"mappings":{"wine":{"properties":{"designation":{"type":"string"},"full_name":{"type":"string"},"winery":{"type":"string"},"style":{"index":"no","type":"string"},"vintage":{"index":"no","type":"string"},"restaurant_ids":{"index":"no","type":"string"},"appellation":{"type":"string"},"vineyard_name":{"type":"string"},"variety_id":{"index":"no","type":"string"},"country":{"type":"string"}}}}}' | |
# => {"ok":true,"acknowledged":true} | |
# verify the mapping | |
curl localhost:9200/test-original/_mapping | |
# => {"test-original":{"wine":{"properties":{"appellation":{"type":"string"},"country":{"type":"string"},"designation":{"type":"string"},"full_name":{"type":"string"},"restaurant_ids":{"type":"string","index":"no"},"style":{"type":"string","index":"no"},"variety_id":{"type":"string","index":"no"},"vineyard_name":{"type":"string"},"vintage":{"type":"string","index":"no"},"winery":{"type":"string"}}}}} | |
# copy the inde |
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
#!/usr/bin/env ruby | |
# | |
# Proof-of-Concept exploit for Rails Remote Code Execution (CVE-2013-0156) | |
# | |
# ## Advisory | |
# | |
# https://groups.google.com/forum/#!topic/rubyonrails-security/61bkgvnSGTQ/discussion | |
# | |
# ## Caveats | |
# |
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 'singleton' | |
# outputs a colored call-trace graph to the Rails logger of the lines of ruby code | |
# invoked during a single request. | |
# | |
# Example: | |
# | |
# 1) Make sure this file is loaded in an initializer | |
# | |
# 2) Add the following to your application.rb in Rails3: |
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 'faraday_middleware' | |
require 'hashie/mash' | |
# Public: GeoIP service using freegeoip.net | |
# | |
# See https://github.com/fiorix/freegeoip#readme | |
# | |
# Examples | |
# | |
# res = GeoipService.new.call '173.194.64.19' |
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 'net/http' | |
# WARNING do not use this; it works but is very limited | |
def resolve url | |
res = Net::HTTP.get_response URI(url) | |
if res.code == '301' then res['location'] | |
else url.to_s | |
end | |
end |
NewerOlder