Skip to content

Instantly share code, notes, and snippets.

@ycombinator
ycombinator / cloudfiles-skip-if-exists.php
Created March 6, 2014 17:33
How to check if a file exists in a Rackspace Cloud Files container
<?php
// Assumption: $container is an instance of OpenCloud\ObjectStore\Resource\Container
$filename = 'mugshot2.png';
try {
// Try to retrieve the file, but only its headers to save
// bandwidth and time.
@Remiii
Remiii / README.md
Last active August 29, 2015 14:03
Git Noob

Git Noob

Yo les Noobs, c'est ici que cela se passe ! 👊

Configuring a remote for a fork and Syncing a fork

$ git remote add user git@github.com:user/repo.git
$ git fetch user
$ git checkout -b user-branchName remotes/user/repo
@Remiii
Remiii / README.md
Last active June 1, 2018 05:31
GitHub production pull (machine users)

GitHub production pull (machine users)

This README give steps in order to use GitHub machine users... 😎 In case of a first GitHub setup please refer to GitHub set up article.

/home/myuser/.ssh/
    |
    +-- config
    |
 +-- myusermachinekey
@cheeaun
cheeaun / bus-stops.geojson
Created April 29, 2015 06:21
A more accurate list of bus stops in Singapore
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<?php
namespace remiii\UtilsBundle\Command\Assets ;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand ;
use Symfony\Component\Console\Input\InputArgument ;
use Symfony\Component\Console\Input\InputInterface ;
use Symfony\Component\Console\Input\InputOption ;
use Symfony\Component\Console\Output\OutputInterface ;
@Remiii
Remiii / README.md
Last active August 28, 2015 13:59
Hubot MamaCake (Paris 18e)
@Remiii
Remiii / AssetsUpdateHeadersCommand.php
Last active September 18, 2015 08:32
Update headers assets on S3 (CloudFront)
<?php
// src/remiii/UtilsBundle/Command/Assets/AssetsUpdateHeadersCommand.php
namespace remiii\UtilsBundle\Command\Assets ;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand ;
use Symfony\Component\Console\Input\InputArgument ;
use Symfony\Component\Console\Input\InputInterface ;
use Symfony\Component\Console\Input\InputOption ;
@ethicka
ethicka / localhost-ssl.md
Last active April 12, 2024 12:26 — forked from jonathantneal/README.md
Local virtualhost SSL websites on Mac OS Sierra

Local virtualhost SSL websites on Mac OS Sierra

These instructions will guide you through the process of setting up a wildcard SSL for your local virtualhosts for offline development. Most importantly, this configuration will give you the happy, green lock in Chrome.

These instructions have only been tested on Mac OS Sierra using the pre-installed Apache and PHP versions. These instructions also assume you have virtualhosts set up locally already.


Configuring SSL

@heapwolf
heapwolf / iccat.sh
Last active March 8, 2017 16:06
Download and show image in terminal (iterm2 only)
#!/bin/bash
function print_image() {
printf "\033]"
printf "1337;File="
echo -n "$1" | base64 -D | wc -c | awk '{printf "size=%d",$1}'
printf ";inline=1:"
echo -n "$1"
printf "\a\n"
}
@keeth
keeth / api.tf
Last active January 13, 2021 14:34
Apex + Terraform + AWS Lambda + API Gateway + JSON Encoded Errors + CORS
resource "aws_api_gateway_rest_api" "myApi" {
name = "myApi-${var.env}"
description = "My awesome API (${var.env} environment)"
}
resource "aws_api_gateway_deployment" "myApi" {
depends_on = [
"aws_api_gateway_integration.myApi_myEndpoint_post",
"aws_api_gateway_integration_response.myApi_myEndpoint_post",
"aws_api_gateway_integration_response.myApi_myEndpoint_post_400",