Skip to content

Instantly share code, notes, and snippets.

@phatduckk
phatduckk / t.js
Last active September 28, 2017 16:30
function redirectDefault(url, urls) {
var iframe = document.createElement("iframe");
iframe.style.border = "none";
iframe.style.width = "1px";
iframe.style.height = "1px";
iframe.onload = function() {
redirect(redirectDefault, urls);
};
self.manager!.GET("https://itunes.apple.com/search",
parameters: ["term": searchBar.text],
success: { (operation: AFHTTPRequestOperation!,responseObject: AnyObject!) in
println("JSON: " + responseObject.description)
},
failure: { (operation: AFHTTPRequestOperation!,error: NSError!) in
println("Error: " + error.localizedDescription)
})
<?php
$base = "https://www.lootsy.com/api/1.2/catalog?tag=%24f&beforeId=";
$ids = [];
$items = [];
do {
$beforeId = empty($ids) ? "" : end($ids);
$url = $base . $beforeId;
echo "$url\n";
- (UIImage *)screenshotBlurred {
UIImage *blurItemImage = [self.screenshot stackBlur:25];
return blurItemImage;
}
- (UIImage *)screenshot {
CGRect rect = [self bounds];
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurrentContext();
[self.layer renderInContext:context];
package com.jeraff.sell.net.apiclient.sentry;
import javax.net.ssl.*;
import java.security.KeyStore;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.Collection;
import java.util.List;
public class TrustSentry {
2013-07-30 11:15:35,926 WARN net.kencochrane.raven.connection.AbstractConnection - An exception due to the connection occurred, a lockdown will be initiated.
net.kencochrane.raven.exception.ConnectionException: An exception occurred while submitting the event to the sentry server.
at net.kencochrane.raven.connection.HttpConnection.doSend(HttpConnection.java:111)
at net.kencochrane.raven.connection.AbstractConnection.send(AbstractConnection.java:78)
at net.kencochrane.raven.Raven.sendEvent(Raven.java:59)
at com.jeraff.sell.website.server.handler.MainHandler.handle(MainHandler.java:87)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1085)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1021)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:136)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:258)
-Xms384m
-Xmx1200m
-XX:MaxPermSize=350m
-XX:ReservedCodeCacheSize=96m
-XX:+UseCodeCacheFlushing
-XX:+UseCompressedOops
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.mongodb.mongod</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/mongodb/bin/mongod</string>
public class StringSomethingTypeConverter extends JeraffTypeConverter<String> {
@Override
public String convert(String input, Class<? extends String> targetType, Collection<ValidationError> errors) {
if (StringUtils.isBlank(input)) {
boolean paramSent = getBean().getContext().getRequest().getParameterMap().containsKey(FIELD_NAME)
if (paramSent) {
} else {
}
<script type="text/javascript">
var tumblr_link_url = "http://www.example.com/permalink/my-article";
var tumblr_link_name = "My Awesome Article";
var tumblr_link_description = "<" + "script type='text/javascript'>alert('9');<" + "/script>";
</script>
<!-- Put this code at the bottom of your page -->
<script type="text/javascript">
var tumblr_button = document.createElement("a");
tumblr_button.setAttribute("href", "http://www.tumblr.com/share/link?url=" + encodeURIComponent(tumblr_link_url) + "&name=" + encodeURIComponent(tumblr_link_name) + "&description=" + encodeURIComponent(tumblr_link_description));