Skip to content

Instantly share code, notes, and snippets.

View obonyojimmy's full-sized avatar
💻
probably coding

jimmycliff obonyo obonyojimmy

💻
probably coding
View GitHub Profile
function fullSync(page = 1) {
let open = indexedDB.open("books", 1);
// Set up the database schema
open.onsuccess = evt => {
let db = open.result;
fullSyncPage(db, 1);
};
}
@dweldon
dweldon / meteor-nginx
Last active January 22, 2024 06:53
This is an example of how to configure nginx to serve a meteor app.
server {
listen [::]:80;
listen 80;
server_name app.example.com;
return 301 https://$server_name$request_uri;
}
server {
@JeffBelback
JeffBelback / docker-destroy-all.sh
Last active December 12, 2023 17:47
Destroy all Docker Containers and Images
#!/bin/bash
# Stop all containers
containers=`docker ps -a -q`
if [ -n "$containers" ] ; then
docker stop $containers
fi
# Delete all containers
containers=`docker ps -a -q`
if [ -n "$containers" ]; then
docker rm -f -v $containers
@josephspurrier
josephspurrier / aescmd.go
Created December 23, 2014 07:11
Golang - Encrypt, Decrypt, File Read, File Write, Readline
package main
import (
"bufio"
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"fmt"
"io"
"io/ioutil"
@lehtu
lehtu / how-to-setup-eslint-for-meteor.md
Last active October 17, 2023 06:07
How to setup eslint for Meteor project

How to setup eslint for Meteor project

Usage

  • install dependencies
  • setup .eslintrc to the root of your project
  • run eslint .

Dependencies

Install all needed dependencies

@Atinux
Atinux / async-foreach.js
Last active October 10, 2023 03:04
JavaScript: async/await with forEach()
const waitFor = (ms) => new Promise(r => setTimeout(r, ms))
const asyncForEach = async (array, callback) => {
for (let index = 0; index < array.length; index++) {
await callback(array[index], index, array)
}
}
const start = async () => {
await asyncForEach([1, 2, 3], async (num) => {
await waitFor(50)
@magegu
magegu / multipart.js
Last active July 11, 2023 20:12
mutipart upload for aws s3 with nodejs based on the async lib including retries for part uploads
/*
by Martin Güther @magegu
just call it:
uploadFile(absoluteFilePath, callback);
*/
var path = require('path');
var async = require('async');
@dariocravero
dariocravero / README.md
Created October 20, 2012 05:25
Save files in Meteor

Create a Meteor app and put the client_/server_ files in a client/server directories. Also, create a public dir to save the uploaded files.

@roxlu
roxlu / CMakeLists.txt
Last active March 9, 2023 07:11
CMake example that shows how you can build Freetype2 with support for Harfbuzz and Harfbuzz with support for Freetype2. This example uses ExternalProject which is the standard way to include external dependencies. Note that we have to patch Freetype2 and Harfbuzz because their CMakelists are not fully CMake compatible (still depend on pkg-config…
# This CMake file will build Freetype and Harfbuzz as external
# projects. We follow the build description as described here:
# https://sourceforge.net/projects/freetype/files/freetype2/2.5.3/ So,
# first we build Freetype2 w/o Harfbuzz, then we build Harfbuzz with
# freetype support after which we rebuild Freetype2 again.
#
# Both CMake files of Freetype2 and Harfbuzz are depending on
# pkg-config to find the dependencies for both projects. I've
# included a patch for Freetype2 and Harfbuzz which allows you to
# build Freetype2 and Harbuzz with pure CMake features. So I removed