Skip to content

Instantly share code, notes, and snippets.

View pcakhilnadh's full-sized avatar
🎯
Focusing on Dreams

Akhil Nadh PC pcakhilnadh

🎯
Focusing on Dreams
View GitHub Profile
@EvieePy
EvieePy / bot_example.py
Last active April 24, 2024 09:30
A Cogs Example for the rewrite version of - discord.py
import discord
from discord.ext import commands
import sys, traceback
"""This is a multi file example showcasing many features of the command extension and the use of cogs.
These are examples only and are not intended to be used as a fully functioning bot. Rather they should give you a basic
understanding and platform for creating your own bot.
These examples make use of Python 3.6.2 and the rewrite version on the lib.
@aparrish
aparrish / understanding-word-vectors.ipynb
Last active June 24, 2024 18:34
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@victorono
victorono / remove_duplicates.py
Last active April 26, 2024 17:57
Django - remove duplicate objects where there is more than one field to compare
from django.db.models import Count, Max
unique_fields = ['field_1', 'field_2']
duplicates = (
MyModel.objects.values(*unique_fields)
.order_by()
.annotate(max_id=Max('id'), count_id=Count('id'))
.filter(count_id__gt=1)
)
@PurpleBooth
PurpleBooth / README-Template.md
Last active June 30, 2024 00:35
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

<?php
// obligatoire
session_start();
require('config/config.inc.php');
require('vendor/autoload.php'); // load des fichiers Facebook
use Facebook\FacebookSession;
use Facebook\FacebookRedirectLoginHelper;
@hofmannsven
hofmannsven / README.md
Last active June 17, 2024 10:34
Git CLI Cheatsheet
@digitaljhelms
digitaljhelms / gist:4287848
Last active June 28, 2024 13:53
Git/GitHub branching standards & conventions

Branching

Quick Legend

Description, Instructions, Notes
Instance Branch
@barrysteyn
barrysteyn / convert_text_to_decimal.py
Created December 1, 2012 19:39
Convert text to decimal
BITS = ('0', '1')
ASCII_BITS = 8
def bit_list_to_string(b):
"""converts list of {0, 1}* to string"""
return ''.join([BITS[e] for e in b])
def seq_to_bits(seq):
return [0 if b == '0' else 1 for b in seq]