Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am waleoyediran on github.
  • I am waleoyediran (https://keybase.io/waleoyediran) on keybase.
  • I have a public key ASCqmkEn3ZNIIviFXXoKI75beV_LtExPDEmXby-GrrPxdAo

To claim this, I am signing this object:

@waleoyediran
waleoyediran / hello-name.cpp
Created March 5, 2019 09:48
Simple Hello world program in C++ that takes name from standard input.
#include <iostream>
using namespace std;
int main()
{
string name;
cout << "Enter your name: ";
getline(std::cin, name);
cout << "Hello, " << name << "\n";
@waleoyediran
waleoyediran / controller.py
Created August 6, 2018 22:37 — forked from claymcleod/controller.py
Playstation 4 Controller Python
#! /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.
#
@waleoyediran
waleoyediran / artifacts.gradle
Created August 20, 2016 09:37
Gradle Plugin to help with apk naming using a combination of application name, variant and version number
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 ->
@waleoyediran
waleoyediran / jinja2backend.py
Last active July 20, 2016 11:58 — forked from carljm/jinja2backend.py
Adding support for context processors for Jinja2 templates in Django
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
@waleoyediran
waleoyediran / SearchAdapter.java
Last active August 29, 2015 14:27
Simple Search Adapter
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;
$object = array(
'id' => 123,
'message' => 'Testing'
);
$jsonObject = json_encode($object);
$headers ("Content-type: application/json")
$resp = Yii::app()->curl->post($url, $jsonObject, $headers);
#!/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]}
@waleoyediran
waleoyediran / geodateencoder.py
Created August 15, 2014 20:21
A custom encoder that helps serialize AppEngine's GeoPt and datetime objects
import json
import datetime
from time import mktime
from google.appengine.ext import ndb
__author__ = 'oyewale'
class GeoDateEncoder(json.JSONEncoder):
application: you-app-name-here
version: 1
runtime: python
api_version: 1
default_expiration: "30d"
handlers:
- url: /(.*\.(appcache|manifest))
mime_type: text/cache-manifest