Skip to content

Instantly share code, notes, and snippets.

View edufolly's full-sized avatar

Eduardo Folly edufolly

View GitHub Profile
@willurd
willurd / web-servers.md
Last active June 7, 2024 03:53
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@tsprates
tsprates / HmacSHA512.java
Created May 28, 2014 16:44
Hmac SHA512
/**
* HmacSHA512
*
* @see <http://drumcoder.co.uk/blog/2011/apr/21/calculate-hmac-hash-java/>
* @param String value
* @param String secret
* @return String
*/
private String buildHmacSignature(String value, String secret) {
String result;
@mjohnsullivan
mjohnsullivan / MainActivity.java
Last active March 1, 2024 01:28
Android Wear activity that reads and displays sensor data from the device
package com.example.wear;
import android.app.Activity;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.os.Bundle;
import android.support.wearable.view.WatchViewStub;
import android.util.Log;
@hodzanassredin
hodzanassredin / Alternatives.fs
Last active May 13, 2020 22:16
hopac alternatives in fsharp
open System
module AsyncExt =
open System.Threading
let choice workflows =
Async.FromContinuations(fun (cont, _, _) ->
let cts = new CancellationTokenSource()
let completed = ref false
let lockObj = new obj()
let synchronized f = lock lockObj f
/**
* HmacSHA512
*
* @see <http://drumcoder.co.uk/blog/2011/apr/21/calculate-hmac-hash-java/>
* @param String value
* @param String secret
* @return String
*/
private String buildHmacSignature(String value, String secret) {
String result;
@kasperpeulen
kasperpeulen / README.md
Last active June 6, 2024 10:54
How to pretty-print JSON using Dart.
@brock
brock / psql-with-gzip-cheatsheet.sh
Last active May 13, 2024 13:31
Exporting and Importing Postgres Databases using gzip
# This is just a cheat sheet:
# On production
sudo -u postgres pg_dump database | gzip -9 > database.sql.gz
# On local
scp -C production:~/database.sql.gz
dropdb database && createdb database
gunzip < database.sql.gz | psql database
@arya-oss
arya-oss / INSTALL.md
Last active November 18, 2023 13:58
Ubuntu 16.04 Developer Tools installation

Ubuntu 16.04 Developer Tools Installation

First things first !

sudo apt update
sudo apt upgrade

Standard Developer Tools

sudo apt-get install build-essential git
@drulabs
drulabs / FCM_message_single_device_curl_command.txt
Last active June 14, 2023 15:27
Curl command for sending FCM message
curl -i -H 'Content-type: application/json' -H 'Authorization: key=<your_server_key>' -XPOST https://fcm.googleapis.com/fcm/send -d '{
"registration_ids":["registration_ids", "of the", "target", "devices as array"],
"notification": {
"title":"Title of your notification",
"body":"content of your notification"
},
"data": {
"key1" : "value1",
"key2" : "value2",
"key3" : 23.56565,
@aloisdeniel
aloisdeniel / flutter_spanablegrid.dart
Last active August 10, 2023 11:27
Custom GridView with various cell sizes in Flutter
import 'dart:math' as math;
import 'package:flutter/material.dart';
import 'package:flutter/src/rendering/sliver.dart';
import 'package:flutter/src/rendering/sliver_grid.dart';
class _CoordinateOffset {
final double main, cross;
_CoordinateOffset(this.main, this.cross);
}