Skip to content

Instantly share code, notes, and snippets.

- (void) application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
UIApplicationState state = [application applicationState];
if (state == UIApplicationStateBackground || (state == UIApplicationStateInactive)) {
NSDictionary *aps = userInfo[@"aps"];
if (aps) {
NSLog(@"Background fetch started...");
NSString *urlString = [NSString stringWithFormat:@"https://www.apple.com/ac/structured-data/images/knowledge_graph_logo.png?201612081039"];
NSURLSession *session = [NSURLSession sharedSession];
$ ffmpeg -i test.avi output.mp4
ffmpeg version 3.0 Copyright (c) 2000-2016 the FFmpeg developers
built with Apple LLVM version 7.0.2 (clang-700.1.81)
configuration: --prefix=/usr/local/Cellar/ffmpeg/3.0 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libxvid --enable-vda
libavutil 55. 17.103 / 55. 17.103
libavcodec 57. 24.102 / 57. 24.102
libavformat 57. 25.100 / 57. 25.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 31.100 / 6. 31.100
libavresample 3. 0. 0 / 3. 0. 0
Flushing buffer at interval {:instance=>"#<LogStash::Outputs::ElasticSearch::Buffer:0x75dbe831 @stopping=#<Concurrent::AtomicBoolean:0x3869256a>, @last_flush=2016-03-02 17:44:32 +0000, @flush_thread=#<Thread:0x6f8afd38 run>, @max_size=500, @operations_lock=#<Java::JavaUtilConcurrentLocks::ReentrantLock:0xdf6a0be>, @submit_proc=#<Proc:0x464291b8@/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-2.4.1-java/lib/logstash/outputs/elasticsearch/common.rb:55>, @flush_interval=1, @logger=#<Cabin::Channel:0x3c6ceb11 @subscriber_lock=#<Mutex:0x12bcc815>, @data={}, @metrics=#<Cabin::Metrics:0x27f3e44f @channel=#<Cabin::Channel:0x3c6ceb11 ...>, @metrics={}, @metrics_lock=#<Mutex:0x7d121306>>, @subscribers={12840=>#<Cabin::Outputs::IO:0x60e52f16 @lock=#<Mutex:0x66767f0c>, @io=#<IO:fd 1>>}, @level=:debug>, @buffer=[], @operations_mutex=#<Mutex:0x6d8f2161>>", :interval=>1, :level=>:debug, :file=>"logstash/outputs/elasticsearch/buffer.rb", :line=>"90", :method=>"interval_flush"}
input
{
file
{
path => ["/Users/me/Desktop/test_prod_logs/logs2016-01-04.json"]
start_position => "beginning"
type => "json"
codec => "json"
}
}
Page not found (404)
Request Method: GET
Request URL: http://localhost:8000/accounts/login/?next=/o/applications/
Using the URLconf defined in beerstash.urls, Django tried these URL patterns, in this order:
^admin/
^beers/
^admin/
^users/
^o/
The current URL, accounts/login/, didn't match any of these.
org.elasticsearch.common.util.concurrent.EsRejectedExecutionException: rejected execution (queue capacity 1000) on org.elasticsearch.search.action.SearchServiceTransportAction$23@2b7d43d3
import subprocess, os
os.chdir("my/path/here")
print subprocess.call("pwd", shell=True)
subprocess.call("/usr/local/bin/virtualenvwrapper.sh && workon project_name && ./manage.py update_index --remove", shell=True)
/** @jsx React.DOM */
var React = require('react');
var BuildingAppStore = require('./building-store.js');
var Buildingview = require('./building-buildingDetail.js');
var EditBuilding = require('./building-editBuilding.js');
function getBuildings(){
return {items: BuildingAppStore.getBuildings()};
}
from django.db import models
from django.utils.translation import ugettext as _
from colleges.models import College
WEEKDAYS = [
(1, _(u'Monday')),
(2, _(u'Tuesday')),
(3, _(u'Wednesday')),
(4, _(u'Thursday')),
total = 0
sale_products = Product.objects.filter(site_match=from_product.site_match, site_id__in=sale_site_ids)
if sale_products is not None and len(sale_products) > 0:
for product in sale_products:
print product.rating
total += float(product.rating)
rating = total/len(sale_products)
from_product.site_match.sale_site_rating = rating
from_product.site_match.save()
else: