Skip to content

Instantly share code, notes, and snippets.

View francisrod01's full-sized avatar
🎯
Focusing

Francis (dele/he/him) francisrod01

🎯
Focusing
View GitHub Profile
@jayphelps
jayphelps / batchsampling.js
Last active August 18, 2022 23:27
Batch Sampling Example from my talk, Real-time Insights, powered by Reactive Programming
let buffer = getWebSocket()
.bufferTime(1000);
let gate = new BehaviorSubject(true);
let batchSize = 50;
let batchSizeCounter = 0;
let results = gate
.switchMap(enabled => enabled ? buffer : Observable.never())
.do(buffer => {
@dschep
dschep / raspbian-python3.6.rst
Last active October 24, 2023 14:57 — forked from BMeu/raspbian-python3.5.rst
Installing Python 3.6 on Raspbian

Installing Python 3.6 on Raspbian

As of January 2018, Raspbian does not yet include the latest Python release, Python 3.6. This means we will have to build it ourselves, and here is how to do it. There is also an ansible role attached that automates it all for you.

  1. Install the required build-tools (some might already be installed on your system).

@Tamal
Tamal / upload_snap.js
Last active March 28, 2024 13:53
React Native File upload using XMLHttpRequest
_uploadSnap() {
var url = 'http://example.com/upload'; // File upload web service path
var photo = {
uri: this.state.picturePath, // CameralRoll Url
type: 'image/jpeg',
name: 'photo.jpg',
};
var formData = new FormData();
formData.append("file", photo);
@srph
srph / oauth.js
Created February 21, 2016 13:50
axios: interceptor which includes your oauth token in every request as an Authorization header
import axios from 'axios';
// You can use any cookie library or whatever
// library to access your client storage.
import cookie from 'cookie-machine';
axios.interceptors.request.use(function(config) {
const token = cookie.get(__TOKEN_KEY__);
if ( token != null ) {
config.headers.Authorization = `Bearer ${token}`;
@parmentf
parmentf / GitCommitEmoji.md
Last active April 25, 2024 08:18
Git Commit message Emoji
@zirouan
zirouan / gcmserver.php
Last active October 2, 2015 15:05
Simples serviço de registro de Ids GCM
<?php
$acao = $_POST['acao'];
$dispositivos = "dispositivos.txt";
if ($acao == "registrar") {
$fp = fopen($dispositivos, "a+") or die("Erro ao abrir arquivo!");
$registrationId = $_POST['regId'] ."\n";
fwrite($fp, $registrationId) or die("Erro ao escrever no arquivo!");
@vbfox
vbfox / debian-java-make-jpkg.sh
Last active November 4, 2017 20:56
Oracle java package generation for debian
echo "deb http://http.debian.net/debian/ jessie main contrib" | sudo tee -a /etc/apt/sources.list.d/contrib.list
sudo apt-get update && sudo apt-get install java-package libgl1-mesa-glx libxtst6 libxxf86vm1
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u45-b14/jdk-8u45-linux-x64.tar.gz
make-jpkg jdk-8u45-linux-x64.tar.gz
sudo dpkg -i oracle-java8-jdk_8u45_amd64.deb
@sayak-sarkar
sayak-sarkar / sublime-text-3.sh
Last active July 14, 2022 09:18
Gist to install Sublime Text 3 on RHEL 6 +
#!/bin/sh
SHORTCUT="[Desktop Entry]
Name=Sublime Text 3
Comment=Edit text files
Exec=/opt/sublime_text_3/sublime_text
Icon=/opt/sublime_text_3/Icon/128x128/sublime-text.png
Terminal=false
Type=Application
Encoding=UTF-8
Categories=Utility;TextEditor;"
@francisrod01
francisrod01 / PermissionsArrayComponent.php
Last active August 29, 2015 14:01
CakePHP - Check Permissions action
<?php
/**
* @todo CakePHP Permissions Array by Kevin Wentworth (Saco Design, Inc.)
* @todo Handles retrieving all ACL Permissions and storing them in an array.
* @todo Comments and bug reports welcome at kevin at sacode sign dot com
*
* @licensed Licensed under UYOR (Use at Your Own Risk)
* @link http://www.mainelydesign.com/blog/view/getting-all-acl-permissions-in-one-lookup-cakephp-1-3#null
*/
@dbpolito
dbpolito / gist:504389298511a4a679bc
Created May 6, 2014 01:05
Constructor_lib.php
<?php defined('BASEPATH') OR exit('No direct script access allowed');
class Constructor_lib {
function __construct() {
$this->CI =& get_instance();
}
function create_controller_files($tables = NULL, $create = FALSE) {
if(!$tables) $tables = $this->CI->db->list_tables();