Skip to content

Instantly share code, notes, and snippets.

View DiracSpace's full-sized avatar
:shipit:
Hacking the world, one 0x41414141 at a time

Roberto de León DiracSpace

:shipit:
Hacking the world, one 0x41414141 at a time
  • Asterias Software Solutions
  • San Luis Potosi
  • X @0x0302
View GitHub Profile
@michael-galpin
michael-galpin / bits.c
Created February 28, 2012 16:44
K&R exercise 2-6, 2-7, 2-8. Bit shifting FTW!
/*
Exercise 2-6. Write a function setbits(x,p,n,y) that returns x with the n bits that begin at position p set to the rightmost n bits of y, leaving the other bits unchanged.
*/
unsigned int setbits(unsigned int x, int p, int n, unsigned int y)
{
// get n right-most bits of y only
y = ~(~0 << n) & y;
// shift those n bits p-n bits to the left
y = y << (p-n);
// zero out n bits of x starting at p
@gfelber36
gfelber36 / A* Algorithm
Created March 12, 2012 19:08
Javascript Implementation of the A* Algorithm for Pathfinding
/*
Pathfinding using the A* Algorigthm: By Greg Felber
This function is used to determine the quickest path from a starting node to a target node via a connected
series of nodes.
The A* Algorithm begins by checking to see the visible waypoints of the starting node. These connected nodes
will be known as its neighbors. Each neighbors cost "F" will be calculated by summing the distance between
the starting node to the best point, "G", and the best point to the target node, "H". The neighbor with the lowest
cost is selected as the best node and added to the array of closed nodes and removed from the list of open nodes
@samueljackson92
samueljackson92 / fuzzy.py
Created February 11, 2013 16:25
Fuzzy set logic tipping system python code.
#!/usr/bin/env python
#####################################################
#Fuzzy logic implementation of simple tipping system
#Author: Samuel Jackson (slj11@aber.ac.uk)
#Date: 10/2/13
#####################################################
#################################
# Functions for calculating #
@rxaviers
rxaviers / gist:7360908
Last active June 29, 2024 12:13
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:
@tomconte
tomconte / upload_azure_blob_sas.js
Created September 24, 2014 08:13
Upload a Blob to Azure Storage using Shared Access Signatures (SAS) in Node.JS
var fs = require('fs');
var https = require('https');
var blob_host = 'tconeu.blob.core.windows.net';
var blob_container = 'tessel-uploads';
// Use any tool to generate a Shared Access Key e.g. Azure Management Studio
var blob_sas = '?sr=c&sv=2014-02-14&si=tessel&sig=xxxxRv%2xxxxUTd8xxxxMKc0xxxxi%2Fxxxxw6VsxxxxGjdJxxxx';
var blob_name = 'test.jpg';
@heyalexej
heyalexej / gsm-setup.md
Last active June 12, 2024 12:35
SIM Card Management Through GSM Modem On Linux

SIM Card Management Over GSM Modem

A small guide on how to send and receive USSD codes on Linux

I am using the built in GSM (UMTS) modem of my Thinkpad X1 extensively because I am often in places with flaky internet connections. I connect through the standard Network Manager on Ubuntu and everything works fine. There was one major annoyance though. Every time I wanted to top up the SIM balance or book a new package, I needed a phone to send and receive USSD codes. So I took some time to figure out how to do it from the shell. I wrote this down as a help for others and a reminder for myself. Without further ado...

First intsall gammu and picocom.

~  sudo apt-get install -y gammu picocom
@mandiwise
mandiwise / Update remote repo
Last active June 21, 2024 13:14
Transfer repo from Bitbucket to Github
// Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/
// See also: http://www.paulund.co.uk/change-url-of-git-repository
$ cd $HOME/Code/repo-directory
$ git remote rename origin bitbucket
$ git remote add origin https://github.com/mandiwise/awesome-new-repo.git
$ git push origin master
$ git remote rm bitbucket
@rickhenderson
rickhenderson / astar.py
Last active April 15, 2021 19:47 — forked from jamiees2/astar.py
A* Algorithm implementation in Python3.
"""
A* Algorithm implementation in Python.
Written by: James Sigurðarson (jamiees2)
Source: https://gist.github.com/jamiees2/5531924
Modified by Rick Henderson
May 5, 2016: Began updating to Python 3.x. Also improved spacing and comments.
Converted xrange() to range(). Converted raw_input() to input().
"""
@jagrosh
jagrosh / Github Webhook Tutorial.md
Last active June 28, 2024 03:43
Simple Github -> Discord webhook

Step 1 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send commits and other updates

  2. In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe! WebhookDiscord

Step 2 - Set up the webhook on Github

  1. Navigate to your repository on Github, and open the Settings Settings