Skip to content

Instantly share code, notes, and snippets.

View osiloke's full-sized avatar
🎯
Focusing

Osi Emoekpere osiloke

🎯
Focusing
View GitHub Profile
@aradalvand
aradalvand / DockerfileForSvelteKit.md
Last active April 24, 2024 20:31
Dockerfile and .dockerignore for SvelteKit:

*This Dockerfile is intended for SvelteKit applications that use adapter-node. So, the Dockerfile below assumes that you have already installed and configured the adapter.

Dockerfile:

FROM node:18-alpine AS builder
WORKDIR /app
COPY package*.json .
RUN npm ci
COPY . .
RUN npm run build
@ruanbekker
ruanbekker / docker-nfs-volumes.md
Created December 10, 2017 10:43
NFS Volumes with Docker Swarm

Create NFS Volumes:

Creating the NFS Volume:

$ docker volume create --driver local \
  --opt type=nfs \
  --opt o=addr=192.168.1.115,uid=1000,gid=1000,rw \
  --opt device=:/mnt/volumes/mysql-test \
  mysql-test-1
@ronnyhartenstein
ronnyhartenstein / index.ios.js
Last active July 17, 2023 10:14
React Navigation: Parallel Navigators in React Native in a nutshell
import React from 'react'
import { AppRegistry } from 'react-native'
import setup from './setup'
AppRegistry.registerComponent('ReactNavigationTest', setup)
@alexweissman
alexweissman / README.md
Last active January 23, 2021 18:18
Migrating email accounts from a cPanel hosting environment to Mail-in-a-Box

Migrating email accounts from a cPanel hosting environment to Mail-in-a-Box

Part 1: Pregame

  1. Send a mass email to all of your account holders, letting them know that you will be migrating their email accounts to a new server. Send them the instructions from MiaB control panel for connecting to your MiaB server from their mobile/Outlook/Gmail/etc, if applicable. Also, send them a link to the new webmail address. Be sure to give adequate advanced notice (several days, if possible). Advise them to not change their passwords during this time (their passwords will be preserved during migration).
  2. Create a new "test" email account in the MiaB control panel for your domain. This will let MiaB set up the DNS records needed for the domain.

Part 2: Copy credentials

Copy the email account credentials from your cPanel host to MiaB:

@leolara
leolara / debounce.go
Last active July 25, 2022 09:25
Golang port of underscore.js
func debounceChannel(interval time.Duration, output chan int) chan int {
input := make(chan int)
go func() {
var buffer int
var ok bool
// We do not start waiting for interval until called at least once
buffer, ok = <-input
// If channel closed exit, we could also close output
@xdamman
xdamman / install_ffmpeg_ubuntu.sh
Created July 2, 2014 21:03
Install latest ffmpeg on ubuntu 12.04 or 14.04
#!/bin/bash
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04
# Inspired from https://gist.github.com/faleev/3435377
# Remove any existing packages:
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev
# Get the dependencies (Ubuntu Server or headless users):
sudo apt-get update
@msoap
msoap / Raspberry Pi httpd benchmark.md
Last active September 26, 2018 16:09
Raspberry Pi httpd benchmark with wrk

Raspberry Pi httpd benchmark

Total RPS

All:

               Go/fasthttp (10 thr): 930.0 ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■

Nginx (10 thr): 826.1 ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■

@jmoz
jmoz / twitter_favouriter.py
Created August 1, 2013 21:55
Twitter API favouriter
from twitter import Twitter, OAuth, TwitterHTTPError
OAUTH_TOKEN = 'foo'
OAUTH_SECRET = 'bar'
CONSUMER_KEY = 'baz'
CONSUMER_SECRET = 'bat'
t = Twitter(auth=OAuth(OAUTH_TOKEN, OAUTH_SECRET, CONSUMER_KEY, CONSUMER_SECRET))
@ecowden
ecowden / angular-partial-cache-busting
Created January 25, 2013 21:01
Cache busting for AngularJS partials is easy
/*
* Decide on your cache-busting strategy. In this example, we use the current timestamp, which will
* force a change every time the app is visited, but not every time the partial is loaded within a
* visit. Even better would be to use a hash of the file's contents to ensure that the file is always
* reloaded when the file changes and never reloaded when it isn't.
*/
var cacheBustSuffix = Date.now();
// Optionally, expose the cache busting value as a constant so other parts of your app can use it.
ngModule.constant("cacheBustSuffix", cacheBustSuffix);
@coopermaruyama
coopermaruyama / vendor-ffmpeg-heroku
Created October 27, 2012 08:39
Install FFMpeg on heroku (Rails)
## Get FFMpeg working on heroku by building binaries using vulcan
gem install vulcan
vulcan create foo
git clone --depth 1 git://source.ffmpeg.org/ffmpeg
cd ffmpeg