Skip to content

Instantly share code, notes, and snippets.

View hasantayyar's full-sized avatar
⌨️
AFK

Hasan Tayyar Beşik hasantayyar

⌨️
AFK
View GitHub Profile
@hasantayyar
hasantayyar / dynamodb.md
Created July 14, 2015 07:43
dynamodb notes

Important note : Use " -sharedDb " flag whilde starting local dynamodb. otherwise js will use a different profile. And you can't access your tables what created from via cli or other platforms

$ wget http://dynamodb-local.s3-website-us-west-2.amazonaws.com/dynamodb_local_latest.zip
$ unzip ...
....
$ sudo pip install awscli
$ ./DynamoDbLocal.jar --port 8787
@csanz
csanz / MostUsedCommands.md
Created December 31, 2011 19:31
Most used commands

history|awk '{print $2}'|awk 'BEGIN {FS="|"} {print $1}'|sort|uniq -c|sort -r

         288 git
          29 heroku
          28 bin/runserver
          24 cd
          23 node
          13 ll
          11 vi

10 open

@ajdavis
ajdavis / connection_test.py
Created March 27, 2012 03:23
Testing connection behavior in PyMongo
import os
import shutil
import threading
import sys
import time
import pymongo
import re
# Two steps: 1. run the test. 2. parse the log.
@hasantayyar
hasantayyar / countembeded.js
Created March 27, 2012 08:22
mongodb count embeded objects by an atrribute
var map = function() { emit(this.e, { notifications : this.notifications});};
var reduce = function(key, values) {
var count = 0;
values.forEach(function(docs) {
for(var doc in docs.notifications){
if(docs.notifications[doc].date>1332836355){
count+=1;
}
}
@hasantayyar
hasantayyar / disposablemails.php
Created April 17, 2012 07:35
my disposable email list to prevent abusing
<?php
// has also some orther sites that is not a disposable mail service
$disposalbe = array(
'veryrealemail.com', // mirror of mailinator
'rtrtr.com',
'bobmail.info',
'tradermail.info', // mirror of mailinator
'omurtlak.com',
'mp3dinleq.com', // top spammer
@hasantayyar
hasantayyar / MostUsedCommands.sh
Created April 25, 2012 22:03 — forked from csanz/MostUsedCommands.md
Most used commands
history|awk '{print $2}'|awk 'BEGIN {FS="|"} {print $1}'|sort|uniq -c|sort -r
@hasantayyar
hasantayyar / mongo-weekly-maintenance.js
Created June 10, 2012 13:56
mongodb weekly maintenance script - compact
// compact all collections
db.getCollectionNames().forEach( function(c){ db[c].runCommand("compact"); } )
@hasantayyar
hasantayyar / blogla.html
Created June 13, 2012 12:24
blogla widget
<a title="blogla" style="text-decoration:none;border:0" href="javascript: void((function () {var el=document.getElementById('_blogcu_genel');if(el!=null){el.parentNode.removeChild(el);}var e=document.createElement('script');e.setAttribute('type','text/javascript');e.setAttribute('charset','UTF-8');e.setAttribute('src', 'http://www.blogcu.com/bookmarklet/bookmarklet.js?'+Math.floor(Math.random()*999999));document.body.appendChild(e)})());"><img style="border:0" src="http://static.blogcu.com/images/v2/blogla-plugin.png" alt="blogla" /></a>
@hasantayyar
hasantayyar / README.md
Created August 28, 2012 08:29
uptime monitor with appscript
  • At first run allow gmail access.
  • Add time driven triggers (hour/minute)
@hasantayyar
hasantayyar / twitter_search.py
Created September 17, 2012 06:38
Simple script to pull in Twitter search results and insert into MongoDB
from optparse import OptionParser
from pymongo import Connection
import urllib2
import json
def get_options():
parser = OptionParser(usage="usage: python %prog [options]")
parser.add_option("-t", "--target", default="localhost", dest="target",