Skip to content

Instantly share code, notes, and snippets.

View filad's full-sized avatar

filad

View GitHub Profile
@asika32764
asika32764 / spinner.rb
Created June 24, 2016 01:01 — forked from ellemenno/spinner.rb
ascii spinner
#!/usr/bin/env ruby
# encoding: UTF-8
@dot_cycle = ['⣾','⣽','⣻','⢿','⡿','⣟','⣯','⣷']
#braille random: 0x2800 - 0x28ff
@z_arrow = ['←','↖','↑','↗','→','↘','↓','↙']
@z_b = ['b','ᓂ','q','ᓄ']
@z_d = ['d','ᓇ','p','ᓀ']
@brunoalano
brunoalano / queue.c
Created August 26, 2015 17:32
Circular Queue
/**
* Circular Queue Implementation
*
* This queue will handle any type of objects only changing
* the typedef above.
*
* @author Bruno Alano Medina
* @version 1.0.0
*/
@Zearin
Zearin / python_decorator_guide.md
Last active July 2, 2024 18:56
The best explanation of Python decorators I’ve ever seen. (An archived answer from StackOverflow.)

NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.


Q: How can I make a chain of function decorators in Python?


If you are not into long explanations, see [Paolo Bergantino’s answer][2].

@mycodeschool
mycodeschool / DoublyLinkedList.c
Created November 12, 2013 11:38
Doubly Linked List implementation in C
/* Doubly Linked List implementation */
#include<stdio.h>
#include<stdlib.h>
struct Node {
int data;
struct Node* next;
struct Node* prev;
};
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@Groxx
Groxx / Groxx's Simple Queue in C minor.c
Created February 21, 2010 05:17
Simplest complete queue implementation I've yet seen in C.
/*
Implementation by Groxx, with absolutely no guarantees, so don't complain to me if it breaks stuff.
Feel free to use it for awesome, as needed. Apply liberally, and induce vomiting if you ingest large doses.
Note from #0d15eb: BREAKING CHANGE FROM #1d1057: this is now a generic storage, storing pointers to data. Manage your memory accordingly.
Note: now stores the "next" pointer prior to processing, allowing you to process and pop the first item in the list in one pass without losing your place in the queue (and possibly other shenanigans, this one was just handy for my uses so I changed it).
*/
typedef void * queue_data_type;
struct queue_item {
queue_data_type contents;