Skip to content

Instantly share code, notes, and snippets.

View ssx's full-sized avatar

Scott Robinson ssx

View GitHub Profile

Principles of Adult Behavior

  1. Be patient. No matter what.
  2. Don’t badmouth: Assign responsibility, not blame. Say nothing of another you wouldn’t say to him.
  3. Never assume the motives of others are, to them, less noble than yours are to you.
  4. Expand your sense of the possible.
  5. Don’t trouble yourself with matters you truly cannot change.
  6. Expect no more of anyone than you can deliver yourself.
  7. Tolerate ambiguity.
  8. Laugh at yourself frequently.
@cfallin
cfallin / five_minute_dockerized_github.txt
Last active August 25, 2016 10:36
Five Minute Dockerized GitHub Replacement
To set up a new server with a Gogs instance, similar to GitHub:
1. Create a clean VM with Debian (on e.g. Digital Ocean) and point a (sub)domain to it
2. Log in and change the SSH daemon to listen on port 2222
- edit /etc/ssh/sshd_config, "Port 22" -> "Port 2222", systemctl restart ssh
- log out; log in with "ssh -p 2222 root@..."
3. Install Docker
- https://docs.docker.com/engine/installation/linux/debian/
4. Create data directories
- mkdir /home/gogs
@nl5887
nl5887 / readme.md
Created April 29, 2016 08:17
Modern.IE Windows XP download
@tzmfreedom
tzmfreedom / pg_notify.php
Last active March 8, 2023 23:09
postgresql notify/listen sample
<?php
$db = new PDO(
"pgsql:dbname=postgres host=localhost port=5432", 'postgres', 'postgres', [
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
]
);
$db->exec('LISTEN hoge');
@louim
louim / uploads.yml
Last active December 23, 2022 14:20
Drop-in playbook for Trellis to push and pull uploads from the server to your local machine.
---
- name: Sync uploads between environments
hosts: web
remote_user: "{{ web_user }}"
vars:
project: "{{ wordpress_sites[site] }}"
project_root: "{{ www_root }}/{{ site }}"
tasks:
@domachine
domachine / docker-compose-daemon.sh
Created April 28, 2015 16:29
run docker-compose in daemon mode and attach to web container
docker-compose up -d
docker attach myapp_web_1
@etruta
etruta / alloy.js
Last active October 25, 2018 18:40
Titanium: Another way to handle pause and resume event for android
Alloy.Globals.wasInForeGround = true;
if(OS_ANDROID) {
var androidServiceIntent = Ti.Android.createServiceIntent({ url: "foreground.service.js" });
androidServiceIntent.putExtra('interval', 3000);
Ti.Android.startService(androidServiceIntent);
}
Ti.App.addEventListener('resumed', function(e) {
Ti.API.log("RESUMED YEAH!");
@nl5887
nl5887 / transfer.fish
Last active March 22, 2022 09:07
Bash and zsh alias for transfer.sh. Transfers files and directories to transfer.sh.
function transfer
if test (count $argv) -eq 0
echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"
return 1
end
## get temporarily filename, output is written to this file show progress can be showed
set tmpfile ( mktemp -t transferXXX )
## upload stdin or file
@ericlbarnes
ericlbarnes / bower.json
Last active January 8, 2024 01:52
Gulp, Bower, Bootstrap Sass, FontAwesome
{
"name": "project",
"version": "0.0.0",
"authors": [
"Eric Barnes <me@example.org>"
],
"license": "MIT",
"private": true,
"ignore": [
"**/.*",
@ijansch
ijansch / jsonarrayfun.php
Last active August 29, 2015 14:05
2 common issues in php based apis
<?php
// Issue 1, empty associative arrays (dictionaries) become regular arrays.
$dictionary = array('key' => 'value');
var_dump(json_encode($dictionary)); // gives '{"key":"value"}';
unset($dictionary['key']);
var_dump(json_encode($dictionary)); // Gives '[]' -> json dictionary turned into array