Skip to content

Instantly share code, notes, and snippets.

View d30jeff's full-sized avatar
💭
Eating caviar and hacking famine

Deojeff d30jeff

💭
Eating caviar and hacking famine
View GitHub Profile
@d30jeff
d30jeff / test.py
Last active August 29, 2015 14:15
(Anti Vowel) [Codecademy] Bullshit error. This is impossible
def anti_vowel(text):
vowels = ['a','e','i','o','u','A','E','I','O','U']
new_word = []
for piece in text:
if piece in vowels:
new_word.append("")
else:
new_word.append(piece)
return "".join(new_word)
@d30jeff
d30jeff / scrabble.py
Created February 17, 2015 15:44
Scrabble Score [Code Academy]
score = {"a": 1, "c": 3, "b": 3, "e": 1, "d": 2, "g": 2,
"f": 4, "i": 1, "h": 4, "k": 5, "j": 8, "m": 3,
"l": 1, "o": 1, "n": 1, "q": 10, "p": 3, "s": 1,
"r": 1, "u": 1, "t": 1, "w": 4, "v": 4, "y": 4,
"x": 8, "z": 10}
def scrabble_score(word):
total = 0
for piece in word:
piece = piece.lower()
@d30jeff
d30jeff / test.py
Created March 9, 2015 07:53
What is this
helper.write_json(resp, falcon.HTTP_201, {
'id': obj.id,
'school_name': obj.school_name,
'study_period': obj.study_period,
'highest_award': obj.highest_award
})
{
alt_tel_num1: ""
alt_tel_num2: ""
archived: false
cell_num: "0168028426"
chi_name: "Chinese Name"
church_name: "Church"
denom_id: 1
edit_seq: 1
email_addr: "deojeff@email.com"
@d30jeff
d30jeff / aaa.js
Created March 16, 2015 01:54
change
switch(msgType) {
fadeTarget.children[0].children[1].children[0].innerHTML = 'Success';
case 'create':
domClass.add(fadeTarget, 'lightblueColor');
domClass.add(fadeTarget.children[0].children[0], 'popupCreate');
boxColor = 'lightblueColor';
@d30jeff
d30jeff / confirm_dialog.js
Created March 16, 2015 09:23
Confirm dialog
<!-- In Dialogs.js -->
onDelete: function(evt) {
confirmBox.show();
}
on(widget.deleteButton, 'click', func.onDelete);
<!-- HTML in Dialogs.html -->
@d30jeff
d30jeff / gist:708b2543c56f73fe517a
Created March 17, 2015 01:26
dis is unpossible..!1
// Dialog.js
var widget = {
confirmDeleteButton: registry.byId('confirmDeleteButton'),
};
var func = {
onAwesome: function(evt) {
alert(1);
}
};
@d30jeff
d30jeff / main.js
Last active August 29, 2015 14:17
Main.js
<!-- HTML -->
<div id="basicWipeNode" class="popupMessageBox" data-dojo-type="dijit/layout/ContentPane" style="width: 200px; height: 50px;">
<b id="messageContainer"></b>
</div>
<!-- End of HTML -->
loadMsgBox: function(msg, msgType) {
var messageBox = dom.byId('basicWipeNode');
GET:
curl -X GET http://localhost/api/modules
DELETE:
curl -X DELETE http://localhost/api/single_module/{id}
POST:
curl -X POST -h "Content-Type:application/json" -d '{"key":"value","key2":"value"}' http://localhost/api/modules
PUT:
@d30jeff
d30jeff / db.py
Created April 7, 2015 03:00
Python
class Account(Base):
__tablename__ = 'acct'
__table_args__ = (
UniqueConstraint('code'),
{'schema': 'accounting'}
)
id = Column(Integer, Sequence('acct_id_seq', schema='accounting'), primary_key=True)
code = Column(String(10), nullable=False)