Skip to content

Instantly share code, notes, and snippets.

View parhammmm's full-sized avatar
💻
Developing

Parham Saidi parhammmm

💻
Developing
View GitHub Profile
# Step 1: install https://chrome.google.com/webstore/detail/replace-youtubes-home-wit/nfffnooajndeeejgejfkbphjocpkblog?hl=en
# Step 2: add the following to chrome-extension://cjpalhdlnbpafiamejdnhcphjbkeiagm/dashboard.html#1p-filters.html
youtube.com##:matches-path(/feed/explore) .ytd-page-manager
youtube.com##:xpath(//*[@id="items"]/ytd-guide-entry-renderer[1])
youtube.com##:xpath(//*[@id="items"]/ytd-guide-entry-renderer[2])
youtube.com##:xpath(//*[@id="section-items"]/ytd-guide-entry-renderer[2])
youtube.com##:xpath(//*[@id="sections"]/ytd-guide-section-renderer[3])
youtube.com##:xpath(//*[@id="sections"]/ytd-guide-section-renderer[4])
youtube.com##:xpath(//*[@id="footer"])
@parhammmm
parhammmm / deploy_with_ebcli3_on_circleci.md
Created May 5, 2017 14:31 — forked from RobertoSchneiders/deploy_with_ebcli3_on_circleci.md
Settings to deploy to AWS Elastic Beanstalk on CircleCi (EB Cli 3)

This is how I configured the deploy of my rails apps to AWS Elastic Beanstalk through CircleCI.

Configure Environments Variables

On Project Settings > Environment Variables add this keys:

  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY
    The aws user must have the right permissions. This can be hard, maybe, this can help you.

Create a bash script to create the eb config file

@parhammmm
parhammmm / pushstate-server.py
Created August 6, 2014 22:00
A simple Python HTTP server, with support for pushState, for use with frontend frameworks such as Backbone.js
#!/usr/bin/env python
import os
import urlparse
import SimpleHTTPServer
import SocketServer
from mimetypes import guess_type
# Directory containing the static files
ROOT_DIR = 'debug/'
#!/usr/bin/env python
#
# Extracts email addresses from one or more plain text files.
#
# Notes:
# - Does not save to file (pipe the output to a file if you want it saved).
# - Does not check for duplicates (which can easily be done in the terminal).
#
# (c) 2013 Dennis Ideler <ideler.dennis@gmail.com>
// Twitter - favourite
function favorite(){$('.favorite:not(.favorited)').each(function(index){ var self = this; setTimeout(function () {$(self).trigger('click');$(self).parents('.tweet').remove();}, (index*1000)+Math.floor(Math.random() * 5000) + 1000); })};
// Twitter - follow
function follow(){$(".wtf-module").remove();$(".not-following .follow-button").each(function(index){var self=this;setTimeout(function(){$(self).trigger("click");$(self).parents(".stream-item").remove()},index*1E3+Math.floor(Math.random()*5E3)+1E3)})};
// Statigram - like pictures
function likePictures(){$els=$(".like_picto_unselected");if($els.length<1){$("body").animate({scrollTop:$("body").height()},1e3,function(){$els=$(".like_picto_unselected");if($els.length<1)return likePictures();$els.each(function(e){var t=this;setTimeout(function(){$(t).trigger("click");console.log("liked")},e*1e4+Math.floor(Math.random()*5e3)+1e3)})})}}
/* AutoSuggest CSS - Version 1.2 */
ul.as-selections {
list-style-type: none;
border-top: 1px solid #888;
border-bottom: 1px solid #b6b6b6;
border-left: 1px solid #aaa;
border-right: 1px solid #aaa;
padding: 4px 0 4px 4px;
margin: 0;
@parhammmm
parhammmm / models.py
Created December 8, 2012 19:20 — forked from treyhunner/models.py
Encrypt and decrypt Django model primary key values (useful for publicly viewable unique identifiers)
# This code is under the MIT license.
# Inspired by this StackOverflow question:
http://stackoverflow.com/questions/3295405/creating-django-objects-with-a-random-primary-key
import struct
from Crypto.Cipher import DES
from django.db import models
def base36encode(number):
"""Encode number to string of alphanumeric characters (0 to z). (Code taken from Wikipedia)."""
@parhammmm
parhammmm / secrypt.php
Created November 30, 2012 12:12
encrypt file with multiple passwords
<?php
/**************************************************************************
LICENCE
- You may copy and redistribute this file under the conditions:
1. The file is credited to lucb1e
2. The file remains unmodified, including this licence
- You may modify and redistribute this file under these conditions:
(This includes porting to another language.)
#!/usr/bin/python
"""Replacement for htpasswd"""
# Original author: Eli Carter
import os
import sys
import random
from optparse import OptionParser
# We need a crypt module, but Windows doesn't have one by default. Try to find
@parhammmm
parhammmm / colour_scheme.py
Created September 10, 2012 18:30
identify whether a colour is warm/cool/neutral
# Shades of white
COLOUR_COLOUR_GHOST_WHITE = ("Ghost White", "F8F8FF")
COLOUR_SNOW = ("Snow","FFFAFA")
COLOUR_IVORY = ("Ivory","FFFFF0")
COLOUR_SEASHELL = ("Seashell","FFF5EE")
COLOUR_CORNSILK = ("Cornsilk","FFF8DC")
COLOUR_OLD_LACE = ("Old Lace","FDF5E6")
COLOUR_CREAM = ("Cream","FFFDD0")
COLOUR_BEIGE = ("Beige","F5F5DC")
COLOUR_LINEN = ("Linen","FAF0E6")