Skip to content

Instantly share code, notes, and snippets.

View dsaw's full-sized avatar

देवेश (devesh) dsaw

View GitHub Profile
@ankurk91
ankurk91 / github_gpg_key.md
Last active April 9, 2024 16:34
Signing git commits using GPG (Ubuntu/Mac)

Github : Signing commits using GPG (Ubuntu/Mac) 🔐

  • Do you have an Github account ? If not create one.
  • Install required tools
  • Latest Git Client
  • gpg tools
# Ubuntu
sudo apt-get install gpa seahorse
# MacOS with https://brew.sh/
@ChrisPenner
ChrisPenner / factorial.py
Last active September 19, 2020 08:13
Tail Recursion in Python without Introspection
from tail_recursion import tail_recursive, recurse
# Normal recursion depth maxes out at 980, this one works indefinitely
@tail_recursive
def factorial(n, accumulator=1):
if n == 0:
return accumulator
recurse(n-1, accumulator=accumulator*n)
@xem
xem / readme.md
Last active May 11, 2024 23:57
Maths & trigonometry cheat sheet for 2D & 3D games

Conventions

  • A = [xA, yA] is a point on the 2D plane. Same for B, C, ...
  • lengths are in any unit (ex: pixels)
  • code snippets are in JavaScript

Degrees to radians

angleRad = angleDeg * Math.PI / 180;

@bbengfort
bbengfort / Makefile
Created January 10, 2016 19:20
Basic Python Project files - my Makefile and the dependencies that I have in everything.
# Shell to use with Make
SHELL := /bin/bash
# Set important Paths
PROJECT := # Set to your project name
LOCALPATH := $(CURDIR)/$(PROJECT)
PYTHONPATH := $(LOCALPATH)/
PYTHON_BIN := $(VIRTUAL_ENV)/bin
# Export targets not associated with files
@eestrada
eestrada / sqlite_regex.py
Last active December 21, 2023 13:46
How to do regular expressions in sqlite3 (using python).
#!/usr/bin/env python
"""How to do regular expressions in sqlite3 (using python)."""
from __future__ import division, absolute_import, print_function, unicode_literals
import re
import sys
import time
import datetime
import sqlite3
@PurpleBooth
PurpleBooth / README-Template.md
Last active June 2, 2024 05:30
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

@tegila
tegila / sim900.mdown
Last active November 2, 2023 09:55
SIM900 TIPS AND TRICKS

TUTORIAL

Attach to GPRS Service

-> AT+CGATT = 1
<- OK

Define PDP Context (cid, PDP type, APN)

-&gt; AT+CGDCONT=1,"IP","zap.vivo.com.br"
@kodekracker
kodekracker / c++Template.cpp
Last active May 19, 2024 15:05
Basic C++ Template for Competitive Programming
/*
* Note: This template uses some c++11 functions , so you have to compile it with c++11 flag.
* Example:- $ g++ -std=c++11 c++Template.cpp
*
* Author : Akshay Pratap Singh
* Handle: code_crack_01
*
*/
/******** All Required Header Files ********/
@bradmontgomery
bradmontgomery / python_projects.md
Last active January 22, 2021 20:27
How I start and manage my python projects.

How I organize my python projects

This is applicable to both OS X and Linux. I use the same tools on both systems. In this guide, I'm going to set up an environment for a Flask app.

Setup

  1. I start by installing pip, virtualenv, then virtualenvwrapper. I seldom use virtualenv directly; I use the wrapper tools instead.
  2. I create a virtualenv for my project: