This file contains hidden or 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 facebookLogin(){ | |
// start Facebook Login | |
Session.openActiveSession(this, true, new Session.StatusCallback() { | |
// callback when session changes state | |
@SuppressWarnings("deprecation") | |
@Override | |
public void call(Session session, SessionState state, Exception exception) { | |
if (session.isOpened()) { |
This file contains hidden or 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
application: you-app-name-here | |
version: 1 | |
runtime: python | |
api_version: 1 | |
default_expiration: "30d" | |
handlers: | |
- url: /(.*\.(appcache|manifest)) | |
mime_type: text/cache-manifest |
This file contains hidden or 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 json | |
import datetime | |
from time import mktime | |
from google.appengine.ext import ndb | |
__author__ = 'oyewale' | |
class GeoDateEncoder(json.JSONEncoder): |
This file contains hidden or 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/sh | |
filename=$1 | |
echo "Begin processing file:" $filename | |
dimensions=$(identify -format '%w %h' $filename) | |
IFS=' ' read -a array <<< "$dimensions" | |
width=${array[0]} | |
height=${array[1]} |
This file contains hidden or 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
$object = array( | |
'id' => 123, | |
'message' => 'Testing' | |
); | |
$jsonObject = json_encode($object); | |
$headers ("Content-type: application/json") | |
$resp = Yii::app()->curl->post($url, $jsonObject, $headers); |
This file contains hidden or 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 android.content.Context; | |
import android.content.Intent; | |
import android.support.v7.widget.RecyclerView; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.Filter; | |
import android.widget.Filterable; | |
import android.widget.ImageView; | |
import android.widget.TextView; |
This file contains hidden or 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 sys | |
import six | |
from django.template.backends.jinja2 import Jinja2, Template | |
from django.template.backends.utils import csrf_token_lazy, csrf_input_lazy | |
from django.template.exceptions import TemplateDoesNotExist | |
from jinja2.exceptions import TemplateSyntaxError | |
from jinja2.utils import import_string | |
import jinja2 |
This file contains hidden or 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
android.applicationVariants.all { variant -> | |
def appName | |
//Check if an applicationName property is supplied; if not use the name of the parent project. | |
if (project.hasProperty("applicationName")) { | |
appName = applicationName | |
} else { | |
appName = "app" | |
} | |
variant.outputs.each { output -> |
This file contains hidden or 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 -*- | |
# | |
# This file presents an interface for interacting with the Playstation 4 Controller | |
# in Python. Simply plug your PS4 controller into your computer using USB and run this | |
# script! | |
# | |
# NOTE: I assume in this script that the only joystick plugged in is the PS4 controller. | |
# if this is not the case, you will need to change the class accordingly. | |
# |
This file contains hidden or 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
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
string name; | |
cout << "Enter your name: "; | |
getline(std::cin, name); | |
cout << "Hello, " << name << "\n"; |
OlderNewer