Skip to content

Instantly share code, notes, and snippets.

View s0nskar's full-sized avatar
💭
I may be slow to respond.

Sanskar Modi s0nskar

💭
I may be slow to respond.
View GitHub Profile
@dokterbob
dokterbob / autoslug.py
Created February 15, 2011 18:46
Mixins for automatically setting (unique) slugs for Django models -- also using values from inline classes.
from django.template.defaultfilters import slugify
class AutoSlugMixin(object):
"""
Automatically set slug to slugified version of the name if left empty.
Use this as follows::
class MyModel(AutoSlugMixin, models.Model):
def save(self):
super(MyModel, self).save()
@AliMD
AliMD / gist:3344523
Created August 13, 2012 22:28
All github Emoji (Smiles)

All github Emoji (Smiles)

ali.md/emoji

:bowtie: | 😄 | 😆 | 😊 | 😃 | ☺️ | 😏 | 😍 | 😘 | :kissing_face: | 😳 | 😌 | 😆 | 😁 | 😉 | :wink2: | 👅 | 😒 | 😅 | 😓

😩 | 😔 | 😞 | 😖 | 😨 | 😰 | 😣 | 😢 | 😭 | 😂 | 😲 | 😱 | :neckbeard: | 😫 | 😠 | 😡 | 😤 | 😪 | 😋 | 😷

😎 | 😵 | 👿 | 😈 | 😐 | 😶 | 😇 | 👽 | 💛 | 💙 | 💜 | ❤️ | 💚 | 💔 | 💓 | 💗 | 💕 | 💞 | 💘 | ✨

@adhithyan15
adhithyan15 / countdown.js
Last active May 10, 2024 09:35
A simple countdown timer in Javascript
/********************************************************************************************************************
Countdown.js is a simple script to add a countdown timer
for your website. Currently it can only do full minutes
and partial minutes aren't supported. This script is a fork of http://jsfiddle.net/HRrYG/ with some
added extensions. Since the original code that I forked was released under Creative Commons by SA license,
I have to release this code under the same license. You can view a live demo of this code at http://jsfiddle.net/JmrQE/2/.
********************************************************************************************************************/
function countdown(minutes) {
var seconds = 60;
var mins = minutes
@jamiees2
jamiees2 / bfs.py
Created May 6, 2013 18:39
Breadth First Search in python
#!/usr/bin/python
# Head ends here
from collections import deque
class Node:
def __init__(self, point,parent=None):
self.point = point
self.parent = parent
explored = []
@mwhite
mwhite / git-aliases.md
Last active July 14, 2024 14:47
The Ultimate Git Alias Setup

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc
@gicmo
gicmo / nix-dataframe.cpp
Created November 26, 2016 20:02
NIX DataFrame Proof of Concept
//NIX DataFrame test
#include <nix.hpp>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include "backend/hdf5/h5x/H5DataType.hpp"
#include "backend/hdf5/h5x/H5Group.hpp"
#include "backend/hdf5/h5x/H5DataSet.hpp"