Skip to content

Instantly share code, notes, and snippets.

View enspdf's full-sized avatar
💻
Reacting ⚛️ :atom:

Sebastian Higuita Castañeda enspdf

💻
Reacting ⚛️ :atom:
View GitHub Profile
@enspdf
enspdf / web-servers.md
Created August 18, 2016 02:47 — forked from willurd/web-servers.md
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
@enspdf
enspdf / gist:a3e671df39b33722fd11dacf3f39f436
Created August 31, 2016 04:25 — forked from prime31/gist:5675017
Simple PHP script showing how to send an Android push notification. Be sure to replace the API_ACCESS_KEY with a proper one from the Google API's Console page. To use the script, just call scriptName.php?id=THE_DEVICE_REGISTRATION_ID
<?php
// API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-API-ACCESS-KEY-GOES-HERE' );
$registrationIds = array( $_GET['id'] );
// prep the bundle
$msg = array

#How you get Sail.js running on Openshift#

This instruction is tested with:

  • Sails.js v0.9.16
  • Node.js 0.10 on Openshift ( 05 May 2014)

###1) package.json

If you use the package.json build by sails new Projectname than you have to add a few fields for openshift – so the server can start you app automatically. Sails uses Grunt to build minify css/js and so on. Openshift dont have grunt installed so you have to add this also.

@enspdf
enspdf / elixirphoenix.bash
Created January 17, 2018 02:52 — forked from likethesky/elixirphoenix.bash
Installing Elixir & the Phoenix framework with Homebrew on OS X
$ brew update && brew doctor # Repeat, until you've done *all* the Dr. has ordered!
$ brew install postgresql # You'll need postgres to do this... you may also need to 'initdb' as well. Google it.
$ brew install elixir
$ mix local.hex # Answer y to any Qs
$ createuser -d postgres # create the default 'postgres' user that Chris McCord seems to like -- I don't create mine w/a pw...
# Use the latest Phoenix from here: http://www.phoenixframework.org/docs/installation -- currently this is 1.0.3
# ** Answer y to any Qs **
$ mix archive.install https://github.com/phoenixframework/phoenix/releases/download/v1.0.3/phoenix_new-1.0.3.ez
@enspdf
enspdf / dont-open-anymore.js
Created January 25, 2018 03:11
Example modal don't open anymore by data
// JS
// register modal component
Vue.component('modal', {
template: '#modal-template'
})
// start app
new Vue({
el: '#app',
Verifying my Blockstack ID is secured with the address 18NrqmPk6BVvZHacwBZQxrhahpQ97fjuj8 https://explorer.blockstack.org/address/18NrqmPk6BVvZHacwBZQxrhahpQ97fjuj8
@enspdf
enspdf / node-docker.md
Created September 13, 2019 16:22 — forked from zeagord/node-docker.md
How to build small Node JS Docker Image and decrease the build time

When we were trying to create a docker image for our Node JS based application, we chose to use the official Node docker image (~700MB). On top of that we need to add the node modules, business logic, etc and so on. The final image size was staggering (~1.2GB). It was not what we wanted. Secondly, the average build time to do NPM install and run a grunt task totally took 15 minutes for every build. I am not even talking about the pain of configuring this for different CI/CD pipelines and environments.

The initial docker file was looking something like this:

Initial Docker File

FROM node:6.10.1-alpine
@enspdf
enspdf / fluttercleanrecursive.sh
Created September 15, 2019 16:58 — forked from jeroen-meijer/fluttercleanrecursive.sh
Flutter Clean Recursive - Clear up space on your hard drive by cleaning your Flutter projects. This script searches for all Flutter projects in this directory and all subdirectories and runs 'flutter clean'. Note: may take a long time for folders with large amounts of projects.
#!/bin/sh
# To run, download the script or copy the code to a '.sh' file (for example 'fluttercleanrecursive.sh') and run like any other script:
# sh ./fluttercleanrecursive.sh
# or
# sudo sh fluttercleanrecursive.sh
echo "Flutter Clean Recursive (by jeroen-meijer on GitHub Gist)"
echo "Looking for projects... (may take a while)"
{"lastUpload":"2020-05-30T23:36:16.235Z","extensionVersion":"v3.4.3"}
@enspdf
enspdf / node-walk.es6
Created December 11, 2020 13:02 — forked from lovasoa/node-walk.es6
Walk through a directory recursively in node.js.
// ES6 version using asynchronous iterators, compatible with node v10.0+
const fs = require("fs");
const path = require("path");
async function* walk(dir) {
for await (const d of await fs.promises.opendir(dir)) {
const entry = path.join(dir, d.name);
if (d.isDirectory()) yield* walk(entry);
else if (d.isFile()) yield entry;