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
sns.publish({ | |
TargetArn: device.arn, | |
MessageStructure: 'json', | |
Message: JSON.stringify({ | |
default: 'you will never see this muah!', | |
APNS_SANDBOX: JSON.stringify({ | |
aps: { | |
'alert': '', | |
'content-available': 1 | |
}, |
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
"""Google spreadsheet related. | |
Packages required: oauth2client, google-api-python-client | |
* https://gist.github.com/miohtama/f988a5a83a301dd27469 | |
""" | |
from oauth2client.service_account import ServiceAccountCredentials | |
from apiclient import discovery | |
def get_credentials(scopes: list) -> ServiceAccountCredentials: |
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
/* | |
This functions opens a video file and extracts the frames and put them into a vector of Mat(its the class for representing an img) | |
*/ | |
void extract_frames(const string &videoFilePath,vector<Mat>& frames){ | |
try{ | |
//open the video file | |
VideoCapture cap(videoFilePath); // open the video file | |
if(!cap.isOpened()) // check if we succeeded | |
CV_Error(CV_StsError, "Can not open Video file"); |
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
#include <stdio.h> | |
#include <string.h> | |
#include <curl/curl.h> | |
struct MemoryStruct { | |
char *memory; | |
size_t size; | |
}; |
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
public class HomeActivity extends MyActionBar { | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.main); | |
ArrayList<String> events = new ArrayList<String>(); | |
events.add("Birthday party"); | |
events.add("Epic party"); |
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
#include <iostream> | |
#include <boost/uuid/sha1.hpp> | |
void display(char* hash) | |
{ | |
std::cout << "SHA1: " << std::hex; | |
for(int i = 0; i < 20; ++i) | |
{ | |
std::cout << ((hash[i] & 0x000000F0) >> 4) | |
<< (hash[i] & 0x0000000F); |