Skip to content

Instantly share code, notes, and snippets.

View tudormunteanu's full-sized avatar
👨‍💻
Crafting and leading. Mostly Web3 these days. 🛠️🚀 #TechLeader

Tudor Munteanu tudormunteanu

👨‍💻
Crafting and leading. Mostly Web3 these days. 🛠️🚀 #TechLeader
View GitHub Profile
@tudormunteanu
tudormunteanu / gist:deee6f2be0df8d554585
Created January 15, 2015 10:30
Safari Push Payload
from djacobs_apns.apns import APNs, Payload
# the payload for Safari
class PayloadSafari(Payload):
def __init__(self, alert=None, url_args=[]):
super(Payload, self).__init__()
self.alert = alert
self.url_args = url_args
self._check_size()
@tudormunteanu
tudormunteanu / gist:1eda7e9f7c5c9dc989e4
Last active August 29, 2015 14:13
Python Iterations
#Plain Lists
list = ["a", "b", "c"]
for v in list:
print v
#Outputs:
#a
#b
#c
#Dictionaries, only by keys
from djacobs_apns.apns import APNs, Frame
from djacobs_apns.apns import APNs, Payload
class PayloadSafari(Payload):
"""
Overwrites the .dict() method with a new format,
for Safari Push Notifs
"""
def __init__(self, alert=None, url_args=[]):
super(Payload, self).__init__()
@tudormunteanu
tudormunteanu / gist:95dd3c86f4060cec24ac
Created March 6, 2015 10:41
zip contents of current directory
zip -r -X push-monkey-desktop-push-notifications.zip ./
@tudormunteanu
tudormunteanu / gist:98e0a851e7c042715caf
Created March 7, 2015 10:32
UIView and playgounds
// Playground - noun: a place where people can play
import UIKit
import XCPlayground
var str = "Hello, playground"
class Person {
var age:Int
// Playground - noun: a place where people can play
import UIKit
class Kpi {
var lineID:Int!
init() {
@tudormunteanu
tudormunteanu / gist:aac8e876e73efbd9eef6
Last active August 29, 2015 14:20
Steak SQL queries
/* User creation */
/* 15:07:36 46.101.30.40 */
INSERT INTO `user` (`fbid`, `firstname`, `lastname`, `nickname`, `email`, `dob`, `password`, `photo`, `wallet`, `accuracy`, `totalPoints`, `totalPredictions`, `correctScores`, `correctResults`, `maxWager`, `maxDeposit`, `sportsmansBetting`, `accountblock`, `facebook`, `verified`, `resetkey`, `id`, `createdAt`, `updatedAt`)
VALUES (NULL, 'Tudor', 'Test1', 'test1', 'tudor@mowowstudios.com', NULL, '15c734fe69c4aa8e31491f439d04811a', '/images/dummyphoto.jpg', '0', '0', '0', '0', '0', '0', '0', '0', '0', NULL, '0', '0', NULL, NULL, '2015-05-05 05:05:05', '2015-05-05 05:05:05');
/* The "id" column from the previous query will be used for the other. Will be known as <user.id>
/* Match creation */
/* 16:16:06 46.101.30.40 */
INSERT INTO `match` (`home`, `away`, `enetpulseid`, `startdate`, `status`, `homescore`, `awayscore`, `createdAt`, `updatedAt`)
VALUES ('Southampton', 'Swansea City', '1', '2015-05-01 16:00:00', 'notstarted', '0', '0', NULL, NULL);
[
{
"players": [
{
"fbid": null,
"firstname": "t1",
"lastname": "t1lastname",
"nickname": "t1 t1lastname",
"email": "tudor@toadlondon.com",
"dob": null,
@tudormunteanu
tudormunteanu / gist:1d1e3bba1223cf508c34
Created May 11, 2015 09:03
Beta error logs 11.05
module.js:339
throw err;
^
Error: Cannot find module 'machinepack-mandrill'
at Function.Module._resolveFilename (module.js:337:15)
at Function.Module._load (module.js:287:25)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object.<anonymous> (/var/www/beta.playsteak.com/api/services/EmailService.js:2:16)
at Module._compile (module.js:431:26)
curl http://beta.playsteak.com/api/game -H 'Steak-Token: 19ffaeda5220a394a7434f18b4283016'
siege -c80 -d2 -t3M http://beta.playsteak.com/api/game -H 'Steak-Token: 19ffaeda5220a394a7434f18b4283016'
curl http://beta.playsteak.com/#/game/25 -H 'Steak-Token: 19ffaeda5220a394a7434f18b4283016'
siege -c80 -d2 -t3M http://beta.playsteak.com/#/game/25 -H 'Steak-Token: 19ffaeda5220a394a7434f18b4283016'
curl http://beta.playsteak.com/api/friend -H 'Steak-Token: 19ffaeda5220a394a7434f18b4283016'