Skip to content

Instantly share code, notes, and snippets.

View gpedro's full-sized avatar

Gabriel Pedro gpedro

View GitHub Profile
@steipete
steipete / ios-xcode-device-support.sh
Last active July 13, 2024 21:09
Using iOS 15 devices with Xcode 12.5 (instead of Xcode 13)
# The trick is to link the DeviceSupport folder from the beta to the stable version.
# sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :)
# Support iOS 15 devices (Xcode 13.0) with Xcode 12.5:
sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/15.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
# Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions
# (A similar approach works for older versions too, just change the version number after DeviceSupport)
@santoshachari
santoshachari / Laravel PHP7 LEMP AWS.md
Last active February 20, 2024 10:00
Laravel 5.x on Ubuntu 16.x, PHP 7.x, Nginx 1.9.x

#Steps to install latest Laravel, LEMP on AWS Ubuntu 16.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.

Install PHP 7 on Ubuntu

Run the following commands in sequence.

sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip
@tkrajina
tkrajina / remove_accents.go
Created January 31, 2016 08:21
Golang remove accents
package main
import (
"fmt"
"unicode"
"golang.org/x/text/transform"
"golang.org/x/text/unicode/norm"
)
@dkarchmer
dkarchmer / ffmpeg-resize.js
Last active March 14, 2024 17:32
Example of NodeJS script to resize videos (to 1080P and 720P) using fluent-ffmpeg
(function () {
var ffmpeg = require('fluent-ffmpeg');
function baseName(str) {
var base = new String(str).substring(str.lastIndexOf('/') + 1);
if(base.lastIndexOf(".") != -1) {
base = base.substring(0, base.lastIndexOf("."));
}
return base;
}
@jeskew
jeskew / SnsBroadcaster.php
Last active July 28, 2020 19:14
Laravel broadcasting with SNS
<?php
use Aws\Sns\SnsClient;
use Illuminate\Contracts\Broadcasting\Broadcaster;
class SnsBroadcaster implements Broadcaster
{
/** @var SnsClient */
private $sns;
/** @var array */
@cescoffier
cescoffier / my-vertx-application
Last active February 26, 2018 18:52
Vert.x init.d service script
#!/bin/bash
###
# chkconfig: 345 20 80
# description: Vert.x application service script
# processname: java
#
# Installation (CentOS):
# copy file to /etc/init.d
# chmod +x /etc/init.d/my-vertx-application
@jrschumacher
jrschumacher / build-and-deploy.sh
Last active April 23, 2019 17:38
Ionic Automated Build and Deploy to HockeyApp
#!/bin/bash
PROJECT_NAME=MyApp
SCHEME_NAME=MyApp
STARTTIME=$(date +%s);
set -e
set -x
### Install dependencies
echo "--- Install dependencies [Time Elapsed $(($(date +%s) - $STARTTIME))s]"

Over the last couple months we noticed some community stagnation and big performance issues with DocPad. Because of that, and few other problems that appeared to be far from being solved, we decided to move to a new stack #109.

What changed?

For backward compatibility purposes, we decided to keep all folders and all automated task commands with the exact same name.

New features should be expected in upcoming versions, this release is intended to be a 1:1 mapping.

Architecture

@kpdecker
kpdecker / nodebf.md
Last active June 2, 2016 18:02
mobile.walmart.com #nodebf 2014

Mobile Server Side Rendering

This year marks the first year that we are doing full scale rendering of our SPA application on our mobile.walmart.com Node.js tier, which has provided a number of challenges that are very different from the mostly IO-bound load of our prior #nodebf.

The infrastructure outlined for last year is the same but our Home, Item and a few other pages are prerendered on the server using fruit-loops and hula-hoop to execute an optimized version of our client-side JavaScript and provide a SEO and first-load friendly version of the site.

To support the additional CPU load concerns as peak, which we hope will be unfounded or mitigated by our work, we have also taken a variety of steps to increase cache lifetimes of the pages that are being served in this manner. In order of their impact:

Event Loop Management

@jctosta
jctosta / screen_cheatsheet.markdown
Last active July 17, 2024 07:07
Screen Cheatsheet

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r