Skip to content

Instantly share code, notes, and snippets.

View rafaelmv's full-sized avatar
🏠
Working from home

Rafa Miranda rafaelmv

🏠
Working from home
View GitHub Profile
@siakaramalegos
siakaramalegos / basic_router.jsx
Last active July 6, 2023 04:02
Basic example of React Router: BrowserRouter, Link, Route, and Switch
// BrowserRouter is the router implementation for HTML5 browsers (vs Native).
// Link is your replacement for anchor tags.
// Route is the conditionally shown component based on matching a path to a URL.
// Switch returns only the first matching route rather than all matching routes.
import {
BrowserRouter as Router,
Link,
Route,
Switch,
} from 'react-router-dom';
@mannodermaus
mannodermaus / MyActivity.java
Created April 6, 2016 22:12
Apply custom background color to Android Notification
package com.github.aurae.notifications;
import android.app.Notification;
import android.os.Bundle;
import android.support.v4.app.NotificationManagerCompat;
import android.support.v7.app.AppCompatActivity;
public class MyActivity extends AppCompatActivity {
@Override protected void onCreate(Bundle savedInstanceState) {
@subfuzion
subfuzion / curl.md
Last active July 18, 2024 17:12
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@bkozora
bkozora / lambdaAMICleanup.py
Last active March 12, 2023 11:55
AWS Lambda Function to Delete AMIs and Snapshots
# Automated AMI and Snapshot Deletion
#
# @author Bobby Kozora
#
# This script will search for all instances having a tag named "Backup" with a value of "Backup".
# As soon as we have the instances list, we loop through each instance
# and reference the AMIs of that instance. We check that the latest daily backup
# succeeded then we store every image that's reached its DeleteOn tag's date for
# deletion. We then loop through the AMIs, deregister them and remove all the
# snapshots associated with that AMI.
@freman
freman / blacklist.scpt
Created December 16, 2015 07:02
Spotify blacklist script.
repeat
if application "Spotify" is running then
tell application "Spotify"
set seenTrack to ""
repeat while player state is playing
if player state is playing then
set theAlbum to album of the current track
set theTrack to name of the current track
set theArtist to artist of the current track
set trackLength to duration of current track
@Scarygami
Scarygami / demo.html
Last active April 16, 2017 22:10
Polymer Google Sign-in
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<title>google-signin Demo</title>
<script src="platform/platform.js"></script>
<link rel="import" href="google-signin/google-signin.html">
@Atem18
Atem18 / gist:4696071
Last active April 19, 2024 11:18 — forked from evildmp/gist:3094281
Tutorial to seting up a django website in production.

Set up Django, Nginx and Gunicorn in a Virtualenv controled by Supervisor

Steps with explanations to set up a server using:

  • Virtualenv
  • Virtualenvwrapper
  • Django
  • Gunicorn
@ndarville
ndarville / settings.py
Last active April 13, 2020 08:18
Django on Travis CI
"""A basic database set-up for Travis CI.
The set-up uses the 'TRAVIS' (== True) environment variable on Travis
to detect the session, and changes the default database accordingly.
Be mindful of where you place this code, as you may accidentally
assign the default database to another configuration later in your code.
"""
import os
@stefanfoulis
stefanfoulis / osx_developer_installation.rst
Last active July 10, 2024 14:36
Instructions on how to setup an OSX developer machine for (python/django) development

OSX Developer System installation

This guide assumes a fresh install of Mac OSX 10.7 Lion.

Brew User