Skip to content

Instantly share code, notes, and snippets.

@lpheller
lpheller / tldr-global-gitignore-ds-store.sh
Created November 11, 2020 08:51
Globally ignore .DS_Store files
# Quick and easy one line command to setup a global .gitignore file and ignore macOS .DS_store files globally
git config --global core.excludesfile "~/.gitignore" && echo .DS_Store >> ~/.gitignore
@rolinger
rolinger / gist:d6500d65128db95f004041c2b636753a
Last active April 2, 2024 03:54
PHP => FCM Push notification tutorial for Android and iOS
Below is a full tutorial on how to setup and use Googles Firebase push notification API for both Android and iOS. It is based on this
earlier implementation of Googles GCM method: https://gist.github.com/prime31/5675017 - FCM is the new method and GCM will eventually be
retired.
## THE BELOW METHOD IS THE NEWER FCM METHOD:
Register your app in the FCM Console: https://console.firebase.google.com (add project)
1. Click on the newly added project, in the upper left menu is the "Overview" and Gear Settings.
2. Click on the GEAR settings icon, and then on "Project Settings"
3. In the main screen, click on "Cloud Messaging"
@gorangajic
gorangajic / es6-spread-immutable-cheatsheet.md
Last active April 11, 2024 08:32
es6 spread immutable cheatsheet

update object

var state = {
    id: 1,
    points: 100,
    name: "Goran"
};

var newState = {
@carcinocron
carcinocron / debugger pause beforeunload
Last active July 10, 2024 08:48
Chrome: pause before redirect
// Run this in the F12 javascript console in chrome
// if a redirect happens, the page will pause
// this helps because chrome's network tab's
// "preserve log" seems to technically preserve the log
// but you can't actually LOOK at it...
// also the "replay xhr" feature does not work after reload
// even if you "preserve log".
window.addEventListener("beforeunload", function() { debugger; }, false)
@shipstar
shipstar / services.md
Last active May 6, 2019 05:10
GitHub + Kanban

Spent a couple minutes poking around at kanban-like alternatives/supplements to labeling:

GitHub uses this and Huboard internally for some projects. Supported by Rally, so probably not going away anytime soon.

GitHub uses this and Waffle internally for some projects.

Looks interesting. (Marking issues from the command-line? Sweet!) It's also pricey.

@adilapapaya
adilapapaya / README
Last active June 27, 2020 11:58
Export Table Data to CSV using Javascript
Example code for exporting data in a table to a csv file.
@fmagrosoto
fmagrosoto / MAIL de PHP
Last active February 20, 2024 19:34
Script personalizable en PHP para subir una imagen al servidor, reducir la imagen a un tamaño específico (configurable), crear un versión en miniatura y eliminar la versión original. Éste script utiliza las librerías de GD incluídas en PHP . Aunado a éste script he incluído una rutina para mostrar las imágenes subidas al directorio con dos links…
<?php
####
## Eliminar una imagen
####
if(isset($_GET['eliminar'])){
$archivo = $_GET['eliminar'];
$directorio = dirname(__FILE__);
if(unlink($directorio.'/'.$archivo)){
header("Location: cargarImagen.php?accion=eliminado");
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: