Skip to content

Instantly share code, notes, and snippets.

View iantearle's full-sized avatar
💭
I may be slow to respond.

Ian Tearle iantearle

💭
I may be slow to respond.
View GitHub Profile
@leodutra
leodutra / git-delete-local-branches.sh
Last active April 17, 2024 16:17
Delete unused local branches ( Git )
#!/bin/sh
# ref: https://devconnected.com/how-to-clean-up-git-branches/
# lists branches that can be deleted/pruned on your local. An option --dry-run is needed
git remote prune origin --dry-run
# In order to clean up remote tracking branches,
# meaning deleting references to non-existing remote branches,
# use the “git remote prune” command and specify the remote name
git remote prune origin
@lennardv2
lennardv2 / 1. Building PHP-MAMP on Apple Silicon M1.md
Last active February 29, 2024 07:57
Native PHP development / MAMP stack on Apple silicon M1

Building the MAMP stack (php, apache & mysql) on Apple Silicon ARM (native)

Update! This tutorial is outdated. Nowadays brew installes m1 binaries just fine. Also use valet: https://laravel.com/docs/9.x/valet. It's 10x easier.

In this tutorial, we'll build the the nescessary packages for ARM via homebrew. After that we'll configure apache2 for using virtual hosts. The native php is ofcourse way faster, see the results of this benchmark below.

TEST NAME SECONDS OP/SEC
@qoomon
qoomon / conventional_commit_messages.md
Last active May 4, 2024 12:39
Conventional Commit Messages

Conventional Commit Messages

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions and generate verion and changelogs

Commit Message Formats

Default

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev -y
sudo apt-get install libfreetype6 libfreetype6-dev -y
sudo apt-get install libfontconfig1 libfontconfig1-dev -y
cd ~
export PHANTOM_JS="phantomjs-2.1.1-linux-x86_64"
wget https://github.com/Medium/phantomjs/releases/download/v2.1.1/$PHANTOM_JS.tar.bz2
sudo tar xvjf $PHANTOM_JS.tar.bz2
sudo mv $PHANTOM_JS /usr/local/share
sudo ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin
@NSURLSession0
NSURLSession0 / cloudkit-server.php
Created February 7, 2016 21:36
CloudKit server-to-server in PHP
<?php
// Constants
$KEY_ID = 'YOUR_KEY_ID';
$CONTAINER = 'YOUR_CONTAINER';
$PRIVATE_PEM_LOCATION = 'eckey.pem'; // Store this file outside the public folder!
// Config
$url = 'https://api.apple-cloudkit.com/database/1/' . $CONTAINER . '/development/public/records/query';
$body = '{"query":{"recordType":"Articles"}}';
@joashp
joashp / PushNotifications.php
Last active July 28, 2023 12:33
Simple PHP script to send Android Push Notification, iOS Push Notification and Windows Phone 8 Push Notification
<?php
// Server file
class PushNotifications {
// (Android)API access key from Google API's Console.
private static $API_ACCESS_KEY = 'AIzaSyDG3fYAj1uW7VB-wejaMJyJXiO5JagAsYI';
// (iOS) Private key's passphrase.
private static $passphrase = 'joashp';
// (Windows Phone 8) The name of our push channel.
private static $channelName = "joashp";
@dbankier
dbankier / gist:c0e15ff0babaa878112f
Created May 8, 2014 13:27
Add copyright/license note to the top of all js files
find . -type f | grep -v node_modules | grep -v modules | grep -v .git | grep -v .json | grep .js | xargs -I{} perl -pi -e 'print "/*\n * Copyright (c) 2011-2014 YY Digital Pty Ltd. All Rights Reserved.\n * Please see the LICENSE file included with this distribution for details.\n */\n\n" if $. == 1' {}
@Rogichi
Rogichi / app.js
Last active December 19, 2015 05:29
Tweet Example (Using VIEZEL Codebird for Appcelerator Titanium. Twitter API 1.1 https://gist.github.com/viezel/5781083 ):
// How Publish a Tweet (Titanium)
// Full Codebird API is here: https://github.com/mynetx/codebird-js
// Codebird for Appcelerator Titanium. Using the Twitter API 1.1: https://gist.github.com/viezel/5781083
//THANKS VIEZEL
@viezel
viezel / app.js
Last active June 15, 2020 19:13
Codebird for Appcelerator Titanium. Using the Twitter API 1.1
// This is an example of use.
// Here we use the new Bearer Token thats make it possible to get tweets without user login
// More info on Bearer here: https://dev.twitter.com/docs/auth/application-only-auth
// Full Codebird API is here: https://github.com/mynetx/codebird-js
var Codebird = require("codebird");
var cb = new Codebird();
cb.setConsumerKey('CONSUMER_KEY', 'CONSUMER_SECRET_KEY');
var bearerToken = Ti.App.Properties.getString('TwitterBearerToken', null);