Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python
# -*- coding: utf-8 -*-
# <bitbar.title>Yahoo Finance Stock Ticker</bitbar.title>
# <bitbar.version>1.0</bitbar.version>
# <bitbar.author>Michael.K</bitbar.author>
# <bitbar.author.github>michael34435</bitbar.author.github>
# <bitbar.desc>Provides a rotating stock ticker in your menu bar</bitbar.desc>
# <bitbar.image>https://s3.amazonaws.com/jamieson.io/bitbar_gfinance.png</bitbar.image>
# <bitbar.dependencies>python</bitbar.dependencies>
import urllib2
@michael34435
michael34435 / 0_reuse_code.js
Created April 12, 2017 03:23
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@michael34435
michael34435 / docker-exec.sh
Last active February 6, 2017 06:16
Close all docker container and execute the command in specified container
#!/bin/bash
function ansi() {
bold=
color=
if [[ -z "$2" ]]; then
color="0"
else
color="$2"
fi
@michael34435
michael34435 / gce-vpn-install.sh
Last active July 24, 2017 02:45 — forked from greenido/gce-vpn-install.sh
Installing vpn on GCE
#!/bin/sh
#
# Automatic configuration of a VPN on GCE debian-7-wheezy server.
# Tested only on debian-7-wheezy.
#
# This work is licensed under the Creative Commons Attribution-ShareAlike 3.0
# Unported License: http://creativecommons.org/licenses/by-sa/3.0/
#
# Thx to: https://github.com/sarfata/voodooprivacy/blob/master/voodoo-vpn.sh for the code/idea
#
@michael34435
michael34435 / install.sh
Last active June 5, 2017 02:42
Laravel Bootstrap Script(v5.3 or above)
#!/bin/bash
function ansi() {
bold=
color=
if [[ -z "$2" ]]; then
color="0"
else
color="$2"
fi
<?php
class Example
{
public function foo1()
{
}
}
<?php
class Example
{
public function foo1()
{
}
public function foo2()
<?php
$foo = new Foo\Bar();
<?php
$fileStr = file_get_contents(YOUR_PHP_FILE_PATH);
$fileContent = "";
$commentTokens = [T_COMMENT];
$commentTokens[] = defined('T_DOC_COMMENT') ? T_DOC_COMMENT : T_ML_COMMENT;
$tokens = token_get_all($fileStr);
foreach ($tokens as $token) {
<?php
/**
* @use Foo\Bar
*/
class Foo
{
public function bar()
{
$bar = new Bar();