Skip to content

Instantly share code, notes, and snippets.

@kaansoral
kaansoral / amazon_ses.py
Created February 14, 2021 16:06
Amazon SES AWS4 signing for Python 2.7 App Engine
#USAGE
#message=amazon_ses.EmailMessage()
#message.subject=title
#message.bodyHtml=html
#message.bodyText=text
#ses=amazon_ses.AmazonSES('access_key','secret')
#logging.info(ses.listVerifiedEmailAddresses().members)
#try: ses.sendEmail("sender",email,message)
#except amazon_ses.AmazonError,e:
# logging.info(e.errorType); logging.info(e.code); logging.info(e.message);
@kaansoral
kaansoral / autorun.js
Last active January 12, 2021 14:03
Auto Re-Run AppEngine NodeJS
var child_process=require('child_process'),fs=require('fs');
var dir="/Users/kaan/project";
process.env.GOOGLE_CLOUD_PROJECT="project-dev";
process.env.GOOGLE_APPLICATION_CREDENTIALS=dir+"/utility/service_account.json";
var node_sdk=null;
function rerun_node_sdk()
{
if(node_sdk) node_sdk.kill();
function can_move(monster,based)
{
// An XY-tree would be ideal, but the current improvements should be enough [16/07/18]
var GEO=G.geometry[monster.map]||{},c=0;
var x0=monster.x,y0=monster.y,x1=monster.going_x,y1=monster.going_y,next,minx=min(x0,x1),miny=min(y0,y1),maxx=max(x0,x1),maxy=max(y0,y1);
if(!based && monster.base) // If entity is a rectangle, check all 4 corner movements
{
var can=true;
[[-monster.base.h,monster.base.vn],[monster.base.h,monster.base.vn],[-monster.base.h,-monster.base.v],[monster.base.h,-monster.base.v]].forEach(function(mxy){
var mx=mxy[0],my=mxy[1];
#include "keymap_common.h"
#include "wait.h"
#include "action_util.h"
#include "action_layer.h"
/*
[22/09/15]
FaceW PCB:
Control/CapsLock: RCtrl
Fn: RShift
*/
/*
Copyright 2011 Jun Wako <wakojun@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
/*
Copyright 2012,2013 Jun Wako <wakojun@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
#include "keymap_common.h"
#include <util/delay.h>
#include "wait.h"
const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
KEYMAP(
ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, BSPC,/*14X*/
TAB, Q, W, E, R, T, Y,FN11, FN5,FN12, P, FN8, FN9, FN30,/*14X*/
LCTL,A,FN13, D, F,FN14, H, J, K, L,SCLN, FN7, ENT, /*13X*/
LSHIFT, Z, X,FN15, V, B, N, M, FN25,FN26, SLSH, UP, FN10,/*13X*/
#include "keymap_common.h"
#include "wait.h"
#include "action_util.h"
/*
[22/09/15]
FaceW PCB:
Control/CapsLock: RCtrl
Fn: RShift
*/
/*
@kaansoral
kaansoral / find_java_import.py
Created July 6, 2015 05:55
Finds Java Imports - Python Snippet
import os,zipfile,sys
#simplified: https://github.com/MDeiml/SublimeJavaImports/blob/master/JavaAddImport.py
#NEWIDEA: an exhaustive search option that searches the files [06/07/15]
paths=[
"/Users/kaan/.cordova/lib/android/cordova/master/framework/src/",
"/usr/local/var/lib/android-sdk/platforms/android-22/android.jar",
"/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/src.zip"
]