Skip to content

Instantly share code, notes, and snippets.

View Telematica's full-sized avatar

Héctor Cerón Figueroa Telematica

View GitHub Profile
@denji
denji / README.md
Last active February 11, 2025 10:01 — forked from istepanov/gist:3950977
Remove/Backup – settings & cli for macOS (OS X) – DataGrip, AppCode, CLion, Gogland, IntelliJ, PhpStorm, PyCharm, Rider, RubyMine, WebStorm
@takekazuomi
takekazuomi / csharp.gitignore
Created April 17, 2014 05:47
.gitignore for C#
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.sln.docstates
# Build results
@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active May 14, 2025 09:43
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@staltz
staltz / introrx.md
Last active May 15, 2025 10:37
The introduction to Reactive Programming you've been missing
@unscriptable
unscriptable / ambiguous-race.js
Last active September 25, 2019 13:20 — forked from briancavalier/ambiguous-race.js
Promise.race is a lie
// This is the function we will use to call Promise.race().
// logWinner is simply a function that races two promises
// and logs the "winner" of the race as a side effect.
function logWinner (p1, p2) {
Promise.race([p1, p2]).then(console.log.bind(console));
}
// Here are 2 promises, p1 and p2. p2 always resolves
// first, since p1 resolves in 20 ms, and p2 resolves
// in 10 ms. By any reasonable definition of "race",
@dhanji
dhanji / BigInt.hs
Last active August 29, 2015 14:07
Add two big integers
add [] [] c = show c
add ls [] c = add ls (replicate (length ls) '0') c
add [] ls c = add (replicate (length ls) '0') ls c
add (x:xs) (y:ys) c = (add xs ys carry) ++ (show result)
where
addInt x y z = (read x :: Int) + (read y :: Int) + z
addition = addInt [x] [y] c
carry = addition `quot` 10
result = addition `mod` 10
@pa-w
pa-w / gist:79fec94db5c79359c444
Last active August 29, 2015 14:08
Código para obtener la disponibilidad de la $estacion de ecobici
<?
function getDisponibilidad($estacion) {
$ch = curl_init("https://www.ecobici.df.gob.mx/CallWebService/StationBussinesStatus.php"); // Ecobici's endpoint. Returns an HTML.
curl_setopt($ch, CURLOPT_POST, true);
$data = array('idStation' => $estacion); // idStation set
// CURL's options...
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_AUTOREFERER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
@leommoore
leommoore / file_magic_numbers.md
Last active May 12, 2025 12:51
File Magic Numbers

File Magic Numbers

Magic numbers are the first bits of a file which uniquely identify the type of file. This makes programming easier because complicated file structures need not be searched in order to identify the file type.

For example, a jpeg file starts with ffd8 ffe0 0010 4a46 4946 0001 0101 0047 ......JFIF.....G ffd8 shows that it's a JPEG file, and ffe0 identify a JFIF type structure. There is an ascii encoding of "JFIF" which comes after a length code, but that is not necessary in order to identify the file. The first 4 bytes do that uniquely.

This gives an ongoing list of file-type magic numbers.

Image Files

@patik
patik / how-to-squash-commits-in-git.md
Last active May 30, 2024 07:59
How to squash commits in git

Squashing Git Commits

The easy and flexible way

This method avoids merge conflicts if you have periodically pulled master into your branch. It also gives you the opportunity to squash into more than 1 commit, or to re-arrange your code into completely different commits (e.g. if you ended up working on three different features but the commits were not consecutive).

Note: You cannot use this method if you intend to open a pull request to merge your feature branch. This method requires committing directly to master.

Switch to the master branch and make sure you are up to date:

@abhiomkar
abhiomkar / LateBinding.js
Created September 18, 2015 10:42
Early Binding & Late Binding in JavaScript
// Early Binding vs Late Binding
// Early Binding
var sum = function(a, b) {
return a + b;
};
var x = 5, y = 6;
var sum5n6 = sum.bind(null, x, y);