Skip to content

Instantly share code, notes, and snippets.

View jengel3's full-sized avatar

Jake jengel3

  • Chicago, Illinois
View GitHub Profile
@jukkatupamaki
jukkatupamaki / 20190417131115_test-setup.ts
Last active June 21, 2023 07:03
How to use Knex.js in a TypeScript project
import { Knex } from 'knex'
export async function up(knex: Knex): Promise<any> {
await knex.schema.createTable('test_setup', (table: Knex.TableBuilder) => {
table.integer('foobar');
});
}
export async function down(knex: Knex): Promise<any> {
await knex.schema.dropTable('test_setup');
@DreaMinder
DreaMinder / A Nuxt.js VPS production deployment.md
Last active October 11, 2023 11:33
Deployment manual for a real-world project built with nuxt.js + koa + nginx + pm2

Example of deployment process which I use in my Nuxt.js projects. I usually have 3 components running per project: admin-panel SPA, nuxt.js renderer and JSON API.

This manual is relevant for VPS such as DigitalOcean.com or Vultr.com. It's easier to use things like Now for deployment but for most cases VPS gives more flexebillity needed for projects bigger than a landing page.

UPD: This manual now compatible with nuxt@2.3. For older versions deployment, see revision history.


Let's assume that you have entered fresh installation of Ubuntu instance via SSH. Let's rock:

@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active May 26, 2024 01:28
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@drewjoh
drewjoh / Cors.php
Created June 13, 2016 22:47
Laravel CORS Middleware
<?php // /app/Http/Middleware/Cors.php
namespace App\Http\Middleware;
use Closure;
class Cors {
public function handle($request, Closure $next)
{
return $next($request)
@jdnavarro
jdnavarro / PKGBUILD
Last active February 13, 2017 17:08
Updated libtinfo AUR PKGBUILD for ncurses-6
# Maintainer: Alexej Magura <agm2819*gmail*>
#
#
pkgname=libtinfo
pkgver=5
pkgrel=7
pkgdesc="symlink to ncurses for use in cuda and other packages"
arch=('any')
url="http://www.gnu.org/software/ncurses/"
license=('unknown')
@jaddie
jaddie / readme.txt
Created May 12, 2015 10:18
Skype - Completely kill adverts
Skype Ad removing tutorial as created by James Dartnell (Jaddie)
First lets remove the access to the adverts themselves:
-- Warning --
This will also stop the Skype home from loading into Skype, although this may be a benefit as its hardly used & simply slows the program down.
Open-up the control panel.
Open-up "Network & Internet" then "Internet Options".
Go to the "Security" tab.
@jengel3
jengel3 / contacts.py
Created April 6, 2015 04:17
Add all users in a Skype group
def addContacts():
import Skype4Py
skype = Skype4Py.Skype()
skype.Attach()
client = Skype4Py.client.Client(skype)
for chat in skype.Chats:
if len(chat.Members) > 50:
print chat.Name
for user in chat.Members:
@bradbeattie
bradbeattie / prison_parser
Last active August 29, 2015 14:10
Parse and modify prison architect save files
# These functions will allow you to
# - Read in Prison Architect save files
# - Modify the read content
# - Save content back into Prison Architect save file formats
import re
from collections import OrderedDict
from pprint import PrettyPrinter
@zenorocha
zenorocha / README.md
Last active February 25, 2019 14:13
Building NodeWebkit apps with Gulp

Tasks

To install the task-runner, run:

$ npm install -g gulp

To install local dependencies, run:

@dhoelzgen
dhoelzgen / base_controller.rb
Last active October 7, 2021 16:19
CORS in Rails 4 APIs
class API::V1::BaseController < ApplicationController
skip_before_filter :verify_authenticity_token
before_filter :cors_preflight_check
after_filter :cors_set_access_control_headers
def cors_set_access_control_headers
headers['Access-Control-Allow-Origin'] = '*'
headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'