Skip to content

Instantly share code, notes, and snippets.

View makuchaku's full-sized avatar

makuchaku makuchaku

View GitHub Profile
[Fri, 09 Apr 2010 23:40:08 -0700] ERROR: execute[start-atd] (/etc/chef/recipes/cookbooks/ey-base/recipes/default.rb line 104) had an error:
/etc/init.d/atd restart
returned 1, expected 0
---- Begin output of
/etc/init.d/atd restart
----
STDOUT: * ERROR: cannot start atd as sysklogd could not start
STDERR:
---- End output of
@makuchaku
makuchaku / gist:1577793
Created January 8, 2012 09:08
Replicate repo watches from a given user profile to a target user profile
/*
1) Open the github page using the account from where you have to copy the watched repos
2) In "watched repos" block, click on "All repositories" => this will show a list of all repos this account is watching
3) Open webkit console and paste this codebase. Replace TARGET_USERNAME & TARGET_PASSWORD with the auth of profile in which you finally want to watch the repos.
4) Wait for all the network calls to complete.
*/
function watch(repoName) {
@makuchaku
makuchaku / gist:1619192
Created January 16, 2012 05:19
Bash script for a pretty looking command prompt with GIT support
############### GIT ################
function parse_git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "("${ref#refs/heads/}")"
}
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
<div class="bubble" style="background: red; border-color: red;">test</div>
<div class="bubble" style="background: green; border-color: green;">test</div>
<style>
.bubble {
margin: 50px;
padding: 50px;
position: relative;
}
.bubble:after {
@makuchaku
makuchaku / bug_branch.sh
Created March 19, 2012 07:24
Git workflow in bash scripts
############ WORK IN PROCESS ############
# -- Copy (append) the following script to your ~/.bashrc file and restart console --
## Workflow ##
# Suppose the current deploy branch is deploy_x_y
# Suppose you have to start work on Bug #100
# Run "bbcreate 100" => a new branch 100_bug will be created out of deploy_x_y and will be checked out (ready to start work)
# You work and finish the changes in your 100_bug branch
# Run "bbpush" to add + commit + push your changes into 100_bug branch. Commit log will be "Fixes for #100"
# You can do bbpush multiple times you like
saveSurvey : function(survey, successCb, errorCb) {
errorCb = errorCb || function(){};
// save the user
this.save(
{survey : survey},
{
success : function() {successCb();},
error : function() {errorCb();}
}
@makuchaku
makuchaku / gist:2768373
Created May 22, 2012 11:05
Test for open/close connections
<?PHP
require_once('../site_config.php'); // include the required classes to make MongoBase class work
class MongoFoo extends Mongo_ModelBase {
}
for($i=0; $i<100; $i++)
{
$mFoo = new MongoFoo();
}
@makuchaku
makuchaku / index.html
Created August 16, 2012 05:38
This is just an experiment! There are certainly better ways to show an image of a MacBook, but none as fun as this :)
<i class="macbook"></i>
require "freshdesk"
client = Freshdesk.new("http://domain.freshdesk.com/", "username", "password")
client.response_format = "json"
ticket = client.post_tickets({:email => "[email protected]", :description => "description", :subject => "subject", :status => 1, :priority => 1})
@makuchaku
makuchaku / chartmill_backtest.py
Created October 3, 2019 00:36
chartmill_backtest : for Technical breakout setups scanner
import json
from datetime import datetime, timedelta
# Copies logic from https://www.quantconnect.com/tutorials/strategy-library/fundamental-factor-long-short-strategy
# Algo storing - https://www.quantconnect.com/docs/algorithm-framework/algorithm-scoring
class ChartMillBackTester(QCAlgorithm):
def Initialize(self):
self.SetCash(1000*1000) # Are't we rich? :D