Skip to content

Instantly share code, notes, and snippets.

View sujeetkv's full-sized avatar
🎯
Focusing

Sujeet Kumar sujeetkv

🎯
Focusing
  • New Delhi, India
View GitHub Profile
@pedrosland
pedrosland / jQuery.ajaxQueue.min.js
Created December 6, 2011 15:39 — forked from Akaryatrh/jQuery.ajaxQueue.min.js
jQuery.ajaxQueue - A queue for ajax requests
/*
* jQuery.ajaxQueue - A queue for ajax requests
*
* (c) 2011 Pedro Sland
* Original by (c) 2011 Corey Frang
*
* Dual licensed under the MIT and GPL licenses.
*
* Requires jQuery 1.5+
*/
@rduplain
rduplain / app.py
Created April 10, 2012 15:58
Flask: serving static file from a separate domain
# http://flask.pocoo.org/mailinglist/archive/2012/4/10/serving-static-file-from-a-separate-domain-in-production/
from flask import Flask, url_for
# Uncomment to set server name.
# SERVER_NAME = 'mianos.com'
app = Flask(__name__, static_folder=None)
app.config.from_object(__name__)
app.add_url_rule('/<path:filename>', endpoint='static',
@reclosedev
reclosedev / lockfile.py
Created June 30, 2012 21:28 — forked from ionrock/lockfile.py
A file locking example
"""
A file lock implementation that tries to avoid platform specific
issues. It is inspired by a whole bunch of different implementations
listed below.
- https://bitbucket.org/jaraco/yg.lockfile/src/6c448dcbf6e5/yg/lockfile/__init__.py
- http://svn.zope.org/zc.lockfile/trunk/src/zc/lockfile/__init__.py?rev=121133&view=markup
- http://stackoverflow.com/questions/489861/locking-a-file-in-python
- http://www.evanfosmark.com/2009/01/cross-platform-file-locking-support-in-python/
- http://packages.python.org/lockfile/lockfile.html
@woodywang
woodywang / parser-bool-mongodb.py
Created December 18, 2012 03:11
A parser which convert SQL-like boolean expression into MongoDB condition expression.
import re
import json
OP_STACK = list()
ELEM_STACK = list()
COMP_STACK = list()
OP_MONGO_MAP = dict({
'AND': '$and',
'OR': '$or',
@rxaviers
rxaviers / gist:7360908
Last active November 18, 2024 10:08
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@swinton
swinton / AESCipher.py
Last active November 8, 2024 18:31
Encrypt & Decrypt using PyCrypto AES 256 From http://stackoverflow.com/a/12525165/119849
#!/usr/bin/env python
import base64
from Crypto import Random
from Crypto.Cipher import AES
BS = 16
pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS)
unpad = lambda s : s[0:-ord(s[-1])]
@PurpleBooth
PurpleBooth / README-Template.md
Last active November 17, 2024 18:07
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@rvl
rvl / git-pushing-multiple.rst
Created February 9, 2016 11:41
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

@bparaj
bparaj / howto_python_flask_iis_wfastcgi
Last active December 1, 2023 05:42
Python Flask on IIS with wfastcgi
Assume IIS is installed. My machine already had IIs 8.5.
Install Python
==============
1. Download web installer (Python 3.6.3).
2. Run as Administrator.
3. Select custom installation for all users.
4. Choose install directory such that there are no white spaces in the path. Not sure if it needs to be done. Just being cautious.
5. Check the box for "Add Python 3.6 to PATH".
@jeromecoupe
jeromecoupe / webstoemp-gulpfile.js
Last active October 12, 2024 17:22
Gulp 4 sample gulpfile.js. For a full explanation, have a look at https://www.webstoemp.com/blog/switching-to-gulp4/
"use strict";
// Load plugins
const autoprefixer = require("autoprefixer");
const browsersync = require("browser-sync").create();
const cp = require("child_process");
const cssnano = require("cssnano");
const del = require("del");
const eslint = require("gulp-eslint");
const gulp = require("gulp");