Skip to content

Instantly share code, notes, and snippets.

View cthos's full-sized avatar
🤔

Alexander Ward cthos

🤔
View GitHub Profile
@cthos
cthos / app.component.ts
Created February 5, 2018 17:29
Making a really dumb Ionic 3 Filelogger
constructor(platform: Platform) {
platform
.ready()
.then(() => {
// statusBar.overlaysWebView(false);
statusBar.styleDefault();
splashScreen.hide();
this.dumblog.realLog = console;
@cthos
cthos / Explanation.md
Last active September 25, 2015 23:59
Explaining what I mean about npm-script and Docker

Dockerfile

FROM node:0.12.7

RUN apt-get update -y
RUN apt-get install -y libcairo2-dev libjpeg62-turbo-dev libpango1.0-dev libgif-dev build-essential g++ software-properties-common

RUN mkdir /home/dockerthing

EXPOSE 4000
foreach ($arr as $key => $val) {
if (!is_numeric($key)) {
continue;
}
// do stuff here.
}
@cthos
cthos / keybase.md
Created December 18, 2014 15:44
Proving I am Me

Keybase proof

I hereby claim:

  • I am cthos on github.
  • I am cthos (https://keybase.io/cthos) on keybase.
  • I have a public key whose fingerprint is B85C 05E8 AC84 D63D 0652 5C6D C80C F249 F9D6 206C

To claim this, I am signing this object:

@cthos
cthos / gist:bd9c6aa952d6260a7a77
Created August 26, 2014 17:50
Bootstrap Output
string(11) "Phase is 0."
array(5) {
[0]=>
string(51) "/home/vagrant/.composer/vendor/drush/drush/commands"
[1]=>
string(25) "/usr/share/drush/commands"
[2]=>
string(20) "/home/vagrant/.drush"
[3]=>
string(14) "/var/www/drush"
@cthos
cthos / gist:f241e181fba10501b8aa
Created August 12, 2014 14:04
Git Push to all Remotes
function git-push-all() {
for i in `git remote`; do
echo "Pushing to $i"
git push $i $1
done
}
@cthos
cthos / gist_test.php
Created April 2, 2012 19:42
Get Raw Gist from Curl
<?php
$test_url = 'https://gist.github.com/2286656';
$bits = explode('/', $test_url);
$id = array_pop($bits);
$raw_url = 'https://raw.github.com/gist/' . $id;
$ch = curl_init($raw_url);
@cthos
cthos / laravel_entity_gen.rb
Created March 4, 2012 20:22 — forked from JonTheWhite/laravel_entity_gen.rb
Laravel Entity Generator
require 'ruble'
command 'Generate Entity Getter/Setters' do |cmd|
cmd.key_binding = 'M1+M2+G'
cmd.scope = 'source.php'
cmd.output = :replace_document
cmd.input = :document
cmd.invoke do |context|
file = context.TM_SELECTED_FILES.match(/([a-zA-Z0-9]+)\.php/)[1]
line = STDIN.read
columns = line.scan(/@Column\(name="([^"]+)", type="([^"]+)"/)
@cthos
cthos / ini_bug.php
Created December 15, 2011 21:39
Php ini dusplay_errors bug?
<?php
error_reporting(E_ALL);
var_dump(ini_get('display_errors'));
var_dump(ini_get('error_reporting'));
//set_error_handler('custHandler');
register_shutdown_function('shutdownHandler');
@cthos
cthos / errrep.php
Created December 15, 2011 20:31
Error Reporting
<?php
error_reporting(0);
set_error_handler('custHandler');
register_shutdown_function('shutdownHandler');
function custHandler($errno, $errstr, $errfile, $errline, $errcontext)
{
echo "Custom handler called.";