Skip to content

Instantly share code, notes, and snippets.

View razvanioan's full-sized avatar

Razvan Ioan Anastasescu razvanioan

View GitHub Profile
@pazdera
pazdera / github-release.sh
Created October 17, 2018 17:06
Create a github release for an existing tag from the command line
#!/usr/bin/env bash
# https://developer.github.com/v3/repos/releases/#create-a-release
repo=$1
tag=$2
name=$3
text=$4
token=$GH_TOKEN
@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"
@jchandra74
jchandra74 / openssl.MD
Last active February 16, 2024 21:23
HOWTO: Create Your Own Self-Signed Certificate with Subject Alternative Names Using OpenSSL in Ubuntu Bash for Window

HOWTO: Create Your Own Self-Signed Certificate with Subject Alternative Names Using OpenSSL in Ubuntu Bash for Window

Overview

My main development workstation is a Windows 10 machine, so we'll approach this from that viewpoint.

Recently, Google Chrome started giving me a warning when I open a site that uses https and self-signed certificate on my local development machine due to some SSL certificate issues like the one below:

Self-Signed SSL Issue in Chrome

@wojteklu
wojteklu / clean_code.md
Last active April 23, 2024 13:15
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@tzmartin
tzmartin / embedded-file-viewer.md
Last active April 22, 2024 19:39
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links

@orottier
orottier / RetryTest.php
Last active July 21, 2023 10:10
Retry function for PHP with exponential backoff
<?php
class RetryTest extends TestCase
{
public function setUp()
{
parent::setUp();
// abuse superglobal to keep track of state
$_GET['a'] = 0;
}
@nepsilon
nepsilon / git-change-commit-messages.md
Last active April 19, 2024 02:23
How to change your commit messages in Git? — First published in fullweb.io issue #55

How to change your commit messages in Git?

At some point you’ll find yourself in a situation where you need edit a commit message. That commit might already be pushed or not, be the most recent or burried below 10 other commits, but fear not, git has your back 🙂.

Not pushed + most recent commit:

git commit --amend

This will open your $EDITOR and let you change the message. Continue with your usual git push origin master.

@ColinMaudry
ColinMaudry / gist:6fd6a5f610f0ac3e6696
Last active November 24, 2023 15:46
cURL examples to query Wikidata

SPARQL Queries (with cURL command) on Wikidata

This gist resulted to be just the spark for a proper article, and won't be maintained here anymore.

The SPARQL endpoint is http://wdqs-beta.wmflabs.org/bigdata/namespace/wdq/sparql and it has a Web form to fire queries. However http://www.wikidata.org/prop/direct/P31 ("instance of") tells you what the entity is.

The repository doesn't have named graphs, or at least the SPARQL endpoint rejects graph queries. The classes of entities (rdf:type) are not described in the repository.

To find the HTML page of an entity (such as https://www.wikidata.org/entity/Q866405), simply replace /entity/ with /wiki/.

@Vestride
Vestride / encoding-video.md
Last active March 12, 2024 16:41
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@ryanpager
ryanpager / application-session-management-with-oauth.md
Last active July 26, 2020 22:54
Application Session Management With OAuth -- Ionic & AngularJS

Application Session Management With OAuth

Fun with AngularJS & Ionic

I don't know about other developers -- but one of the most frustrating things in my mind to get going when starting a new hybrid application is session/authorization management. Do you use OAuth 1, OAuth 2, generic email login, facebook...even thinking about it stresses me out. Unfortunately, no good hybrid (or mobile for that matter) application can escape the need for good authorization (unless it is a stateless app, like a calculator, or something easy).

Personally -- I have come to love the OAuth 2 standard for its simplicity, and standards of operation. It takes some of the stress out of the decision making process when coming up with how to manage application state flow -- something which is especially necessary in [most] mobile (or native) applications. This article is going to focus on one of those pain points -- hybrid mobile app state management, and how to solve it with regards to the marriage of AngularJS & Ion