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
# Downloads a contract's source code from etherscan | |
address=0x922dC160f2ab743312A6bB19DD5152C1D3Ecca33 | |
curl "https://api.etherscan.io/api?module=contract&action=getsourcecode&address=$address" \ | |
| jq -r '.result[0].SourceCode' | sed -e 's/^.//' \ | |
| jq -c '.sources | to_entries[]' | tr '\n' '\0' | xargs -0 -n1 sh -c \ | |
'f=`jq -r ".key" <<< $0` && mkdir -p `dirname $f` && jq -r ".value.content" <<< "$0" > $f' |
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 cursor | |
// Cursor is just a string for flexibility | |
type Cursor string | |
// NewCursor transforms v into json and base64 encodes the json | |
func NewCursor(v any) (*Cursor, error) { | |
b, err := json.Marshal(v) | |
if err != nil { | |
return nil, err |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<Bucket | |
type = "2" | |
version = "2.0"> | |
<Breakpoints> | |
<!-- All Exceptions --> | |
<BreakpointProxy | |
BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint"> | |
<BreakpointContent |
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
apply plugin: 'java' | |
sourceCompatibility = JavaVersion.VERSION_1_7 | |
targetCompatibility = JavaVersion.VERSION_1_7 | |
def logger = new com.android.build.gradle.internal.LoggerWrapper(project.logger) | |
def sdkHandler = new com.android.build.gradle.internal.SdkHandler(project, logger) | |
for (File file : sdkHandler.sdkLoader.repositories) { | |
project.repositories.maven { | |
url = file.toURI() |
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
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request | |
navigationType:(UIWebViewNavigationType)navigationType { | |
NSString *urlString = [[request URL] absoluteString]; | |
if ([urlString hasPrefix:@"js:"]) { | |
NSString *jsonString = [[[urlString componentsSeparatedByString:@"js:"] lastObject] | |
stringByReplacingPercentEscapes]; | |
NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding]; | |
NSError *error; |
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
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |