Skip to content

Instantly share code, notes, and snippets.

View Olliepop's full-sized avatar
💁‍♂️

Oliver Shaw Olliepop

💁‍♂️
View GitHub Profile
@Tom-Alexander
Tom-Alexander / silverstripe_3_2_upgrade.sh
Created November 17, 2015 20:12
Upgrade script for silverstripe 3.2
cd $1
if ! hash jq 2>/dev/null; then
brew install jq
fi
composer install
jq '.require."silverstripe/cms" = "~3.2.0"' composer.json > tmp.$$.json && mv tmp.$$.json composer.json
jq '.require."silverstripe/framework" = "~3.2.0"' composer.json > tmp.$$.json && mv tmp.$$.json composer.json
@Tom-Alexander
Tom-Alexander / README.md
Created November 12, 2015 21:22
Mailcatcher config
  1. gem install mailcatcher
  2. mailcatcher
  3. brew services restart php54
  4. nginx -s reload
  5. Go to http://mail.dev/
Run this in your Mac Terminal (assuming you have the Ionic CLI):
----------------------------------------------------------------
ionic start wkwebviewpolyfilltest
cd wkwebviewpolyfilltest
ionic setup sass
ionic platform add ios
ionic plugin add https://github.com/EddyVerbruggen/cordova-plugin-wkwebview
ionic build
----------------------------------------------------------------
@evo42
evo42 / aloha-config.js
Created December 8, 2011 19:52
Aloha Editor -- send content via ajax to a backend php script to save the data edited with Aloha Editor
( function ( window, undefined ) {
var Aloha = window.Aloha || ( window.Aloha = {} );
Aloha.settings = {
logLevels: { 'error': true, 'warn': true, 'info': true, 'debug': false, 'deprecated': true },
errorhandling: false,
ribbon: false,
locale: 'en',
floatingmenu: {
width: 630,
@chtombleson
chtombleson / silverstripe.conf
Created January 30, 2014 07:04
Silverstripe nginx config
server {
listen 80;
server_name example.com;
root /var/www/example.com;
error_log /var/log/example.com/error.log;
access_log /var/log/example.com/access.log;
location / {
try_files $uri @silverstripe;
}
.
├── actions
├── stores
├── views
│   ├── Anonymous
│   │   ├── __tests__
│   │   ├── views
│   │   │   ├── Home
│   │   │   │   ├── __tests__
│   │   │   │   └── Handler.js
@jbuchbinder
jbuchbinder / string_to_ascii.go
Created May 3, 2013 20:39
Convert UTF-8 Go strings to ASCII bytes.
package main
import (
"unicode/utf8"
)
// Fake converting UTF-8 internal string representation to standard
// ASCII bytes for serial connections.
func StringToAsciiBytes(s string) []byte {
t := make([]byte, utf8.RuneCountInString(s))
@cjus
cjus / sample-nginx.conf
Last active July 12, 2023 14:59
AngularJS Nginx and html5Mode
server {
server_name yoursite.com;
root /usr/share/html;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
}
@cosmocatalano
cosmocatalano / instagram_scrape.php
Last active August 6, 2023 07:32
Quick-and-dirty Instagram web scrape, just in case you don't think you should have to make your users log in to deliver them public photos.
<?php
//returns a big old hunk of JSON from a non-private IG account page.
function scrape_insta($username) {
$insta_source = file_get_contents('http://instagram.com/'.$username);
$shards = explode('window._sharedData = ', $insta_source);
$insta_json = explode(';</script>', $shards[1]);
$insta_array = json_decode($insta_json[0], TRUE);
return $insta_array;
}
@thoop
thoop / nginx.conf
Last active December 8, 2023 21:55
Official prerender.io nginx.conf for nginx
# Change YOUR_TOKEN to your prerender token
# Change example.com (server_name) to your website url
# Change /path/to/your/root to the correct value
server {
listen 80;
server_name example.com;
root /path/to/your/root;
index index.html;