Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View jeanpimentel's full-sized avatar
👨‍💻

Jean Pimentel jeanpimentel

👨‍💻
View GitHub Profile
@jeanpimentel
jeanpimentel / LocalBroadcastReceiver.java
Created September 16, 2019 02:43 — forked from shawnthye/LocalBroadcastReceiver.java
Push Notification - Local Broadcast Receiver and Result Receiver
public class LocalBroadcastReceiver extends BroadcastReceiver {
@Override public void onReceive(Context context, Intent intent) {
Log.d("LocalBroadcastReceiver", "onReceive()");
// Tell the result receiver to CANCEL some specific action.
// eg. do not display System Notification
setResultCode(Activity.RESULT_CANCELED);
}
}
@jeanpimentel
jeanpimentel / AllGattCharacteristics.java
Created August 4, 2019 14:31 — forked from sam016/AllGattCharacteristics.java
Bluetooth GATT Services & Characteristics
package com.sam016.vsflatomation.service.ble;
import java.util.HashMap;
import java.util.UUID;
public class AllGattCharacteristics {
private static HashMap<String, String> attributes = new HashMap();
static {
attributes.put("00002a00-0000-1000-8000-00805f9b34fb", "Device Name");
@jeanpimentel
jeanpimentel / PPT.applescript
Created August 19, 2018 22:38 — forked from botanicus/PPT.applescript
Launch iTerm2 session with 3 split windows and run commands in them.
-- Find more at http://iterm.sourceforge.net/scripting.shtml
launch "iTerm"
tell application "iTerm"
activate
-- ssh in split panes to my varnish stack
set myterm to (make new terminal)
tell myterm
@jeanpimentel
jeanpimentel / facebook-video-download-script.js
Created April 12, 2018 12:38 — forked from aneelkkhatri/facebook-video-download-script.js
Script for downloading Facebook videos
var LINK_TYPE_SD = 'sd_src_no_ratelimit';
var LINK_TYPE_HD = 'hd_src_no_ratelimit';
(function downloadVideo(type) {
function getMyObject(doc) {
var scriptsCollection = doc.getElementsByTagName("script");
var scripts = [];
var regExp = /video_ids/i;
for (var i = scriptsCollection.length - 1; i >= 0; i--) {
var script = scriptsCollection[i].innerHTML;
/*
* Copyright 2018 Lucio Maciel, Rocket.Chat
* Copyright 2016 Serj Lotutovici
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
package pl.kpob.utils.extensions
import android.app.Activity
import android.content.Context
import android.graphics.Color
import android.support.v4.content.ContextCompat
import android.view.WindowManager
import flow.Flow
import org.jetbrains.anko.AlertDialogBuilder
import pl.sisms.gminformix.utils.extensions.supportsLollipop
@jeanpimentel
jeanpimentel / gist:567862db34def27edfae
Created January 27, 2016 16:43
Android Alpha Hex
100% — FF
99% — FC
98% — FA
97% — F7
96% — F5
95% — F2
94% — F0
93% — ED
92% — EB
91% — E8
@jeanpimentel
jeanpimentel / Makefile
Last active June 4, 2023 08:35 — forked from kanedo/Makefile
Makefile for Xcode C++ projects
#############################################################
# #
# Generic Makefile for C++ projects #
# Author: Gabriel <software@kanedo.net> #
# Date: 2014-04-18 #
# Version: 1.0 #
# #
#############################################################
@jeanpimentel
jeanpimentel / test.php
Created July 6, 2012 14:09
Strange behavior in PHP
<?php
class C1 {
protected $propertyProtected = 'foo';
}
class C2 {
public function test() {
$objC1 = new C1();
echo $objC1->propertyProtected;