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
- (void)uploadImage:(UIImage *)image | |
{ | |
//Set up the upload request from our server | |
NSURL *url = [NSURL URLWithString:@"http://<your-server-url-here>/"]; | |
NSURLRequest *request = [NSURLRequest requestWithURL:url]; | |
AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) { | |
// Pull out any required information out of the response | |
NSString *serverDate = [JSON valueForKeyPath:@"date_string"]; |
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/bash | |
# --------------------------------------------------------------------- # | |
# install-changetrack - Install changetrack on debian/ubuntu host. # | |
# # | |
# version 0.1 - cj (2010-08-24) init. # | |
# --------------------------------------------------------------------- # | |
ADMIN="sysadmin@localhost" | |
CONF="/etc/changetrack.conf" |
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 python | |
# -*- coding: utf-8 -*- | |
# ---------------------------------------------------- | |
import redis, random | |
POOL = redis.ConnectionPool(host='localhost', port=6379, db=0) | |
NUSERS = 10000 | |
NTAGS = 500 |
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
from rest_framework.views import exception_handler | |
def custom_exception_handler(exc): | |
""" | |
Custom exception handler for Django Rest Framework that adds | |
the `status_code` to the response and renames the `detail` key to `error`. | |
""" | |
response = exception_handler(exc) |
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
from flask import Flask, request, make_response, session | |
from flaskext.kvsession import KVSessionExtension | |
from datetime import datetime, timedelta | |
from twilio import twiml | |
import json | |
import redis | |
from simplekv.memory.redisstore import RedisStore | |
SECRET_KEY = 'a secret key' |
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
#-*- coding: utf-8 -*- | |
import re | |
import nltk | |
from nltk.tokenize import RegexpTokenizer | |
from nltk import bigrams, trigrams | |
import math | |
stopwords = nltk.corpus.stopwords.words('portuguese') |
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
from flask import Flask, request, make_response | |
from datetime import datetime, timedelta | |
from twilio import twiml | |
app = Flask(__name__) | |
@app.route("/sms") | |
def sms(): | |
#get the cookie value, or default to zero |
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
FROM ansible/centos7-ansible:stable | |
# or, for example, FROM ansible/ubuntu14.04-ansible:stable | |
RUN yum install -y tar | |
RUN ansible-galaxy install geerlingguy.java | |
RUN ansible-galaxy install https://github.com/silpion/ansible-maven.git | |
# Add playbooks to the Docker image | |
COPY site.yml / |
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/python | |
''' | |
InFB - Information Facebook | |
Usage: infb.py user@domain.tld password | |
infb.py | |
http://ruel.me |
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
#-*- coding: utf-8 -*- | |
import re | |
import nltk | |
from nltk.tokenize import RegexpTokenizer | |
from nltk import bigrams, trigrams | |
import math | |
stopwords = nltk.corpus.stopwords.words('portuguese') |
OlderNewer