Skip to content

Instantly share code, notes, and snippets.

Gezim Hoxha hgezim

  • Edmonton, Alberta, Canada
Block or report user

Report or block hgezim

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
hgezim / debugging_filters_in_wp.php
Created Sep 3, 2018
This function displays the hooks attached on a filter so you can see what's messing you up!
View debugging_filters_in_wp.php
function viper_debug_filter( $filter ) {
add_filter( $filter, function( $value ) {
global $wp_filter;
$filters = array();
foreach ( (array) $wp_filter[ current_filter() ]->callbacks as $priority => $functions ) {
foreach ( (array) $functions as $function => $args ) {
$filters['Priority ' . $priority][] = $args;
hgezim /
Created Sep 1, 2018
Download Drip Broadcasts for Backup
import requests
from requests.auth import HTTPBasicAuth
import os
import json
# TODO: replace DRIP TOKEN, :account_id, BACKUP_DIR
broadcasts = requests.get('',
auth=HTTPBasicAuth('DRIP TOKEN', ''),
View npm-debug.log
Last login: Thu Nov 12 13:17:48 on ttys013
ssh -p 64771 ubuntu@ gezim$ ssh -p 64771 ubuntu@
The authenticity of host '[]:64771 ([]:64771)' can't be established.
ECDSA key fingerprint is SHA256:ZR/CnZW46nEaaJBuNh9mEWZqvjxP9ltuVHwSYLWrL/Y.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[]:64771' (ECDSA) to the list of known hosts.
Last login: Thu Nov 12 20:28:28 2015 from
ubuntu@box440:~$ ps aux | grep jest
ubuntu 12528 0.0 0.0 4440 624 pts/3 S+ 20:29 0:00 sh -c gulp env unsymlink; jest --maxWorkers 4
ubuntu 12539 49.7 0.0 1092680 208932 pts/3 Sl+ 20:29 0:04 node /home/ubuntu/frontend/node_modules/.bin/jest --maxWorkers 4
class Post(models.Model):
title = models.CharField(max_length=500)
hn_id = models.CharField(max_length=50, unique=True)
points = models.IntegerField(null=True)
comment_count = models.IntegerField()
comments_link = models.URLField()
date = models.DateTimeField() # datetime that HN post was posted
date_scraped = models.DateTimeField(auto_now_add = True) # date object was scraped from HN
date_modified = models.DateTimeField(auto_now = True) # date this object has been updated (rescraped)
# link the story is linked to -- HN links can be long so set max_length to 2000
hgezim /
Last active Dec 12, 2015
Python script that gets every line in every file in the current directory and appends '//' to the front.
"""Python script that gets every line in every file in the current directory and appends '//' to the front."""
import os
file_names = os.listdir('.')
for file in file_names:
opened_file = open(file)
lines = opened_file.readlines()
for line in lines:
print "// %s" % (line),
View gist:4478170
## LockFile function ##
# example:
# main() {
# LockFile create
# RunScriptStuff
# LockFile remove
# }
hgezim / JavaScript Community
Last active Dec 24, 2018
JavaScript Community FAQs
View JavaScript Community

Google+ JavaScript Community FAQs

These are frequently asked question in the JavaScript Community.

  1. How do I do thing in Java?

That's a great question! Please find a Java community on Google+ to ask. JavaScript is not the same as Java. Here's a good explanation of the differences between Java and JavaScript:

View gist:4410072
sendListToEmails: (from_email, to_emails, list_id, uid) ->'blah')
blah_blue: () ->
console.log "Sup."
create_user: () ->
console.log "In createuser Meteor method."
View gist:4053581
TeamDoListRouter = Backbone.Router.extend
initialize: (options) ->
# IMPORTANT: These get matched in the reverse order that they show up
@route(/\?*/, "home") #Match / followed by a question mark or 0 question marks
@route(/([a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12})/, "list") # Match a GUID
home: () ->
Session.set('page', 'home')
this.navigate ''
View gist:2271780
t = (s, d) ->
s = s.replace new RegExp("{{#{k}}}", 'g'), v for k, v of d
return s
You can’t perform that action at this time.