Skip to content

Instantly share code, notes, and snippets.

@guyromm
guyromm / todo.tag
Created January 23, 2015 18:56
riot.js todo list has become editable!
<todo>
<h3><timer></timer> - { opts.title }</h3>
<ul>
<li each={ items }>
<label class={ completed: done }>
<input type="checkbox" checked={ done } onclick={ parent.toggle }> { title }
</label>
<a href="#" onclick={ parent.editExisting }>edit</a>
#!/usr/bin/env coffee
http = require 'http'
fs = require 'fs'
oppressor = require 'oppressor'
Readable = require 'stream'
.Readable
server = http.createServer (req,res) =>
stream = fs.createReadStream __dirname+'/node_modules/coffee-script/lib/coffee-script/parser.js'
stream.pipe oppressor req
@guyromm
guyromm / parseprocs.py
Last active August 29, 2015 14:07
parseprocs - jenkins process type parse
#!/usr/bin/env python
# usage
# 1. run on a jenkins node to get a grouping of processes by type with memory consumption:
# ps aux | /root/parseprocs.py
# 2. get a detail of which processes were included under a particular set of tags:
# ps aux | /root/parseprocs.py celery,python,user_attrs_actions
~/bin/shoot.sh
Alt + Print
--- /root/gitweb.cgi 2014-04-02 00:19:56.885072998 +0200
+++ /usr/lib/cgi-bin/gitweb.cgi 2014-04-02 00:38:59.125072998 +0200
@@ -5822,6 +5822,7 @@
if (defined $snapshot_links) {
print " | " . $snapshot_links;
}
+ print " | ".$commit;
print "</td>\n" .
"</tr>\n";
}
@guyromm
guyromm / mvtracker.py
Created September 26, 2012 07:06
git helper for diffs between revisions that have files shuffled between folders (not through git mv)
#!/usr/bin/python
# this script tries to guess file moves between revisions according to matches in the files basename.
# i.e - if the file was moved between folders but did not change its name - it'l pop up in our matches
# if there are multiple files changing location with the same basename false positives will appear.
import re,os,json,sys,commands
branchfrom = sys.argv[1] #'staging'
branchto = sys.argv[2] #'maxim.d-435'
@guyromm
guyromm / post-receive-campfire.rb
Created April 29, 2012 08:35
an improved post-receive-campfire
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'rubygems'
gem 'broach'
require 'broach'
require 'yaml'
require 'time'
config = YAML::load(File.open(File.join(File.dirname(__FILE__), 'config.yml')))
@guyromm
guyromm / index.html
Created April 25, 2012 13:04
monacasino support embedding
<!doctype html><html><head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mona Casino, Casino en ligne</title>
<link rel="stylesheet" href="http://www.monacasino.com/style.css" type="text/css" media="screen">
<script src="http://www.monacasino.com/js/jquery.min.js" type="text/javascript"></script>
<script src="http://www.monacasino.com/js/jQuery.BlackAndWhite.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
var to = false, dpartner = $("#down_pic");
milez@niko-hp:~/Projects/GameServer-jenkins$ ./buildenv.sh
Clean old env
rm: cannot remove `./bin': No such file or directory
rm: cannot remove `./include': No such file or directory
rm: cannot remove `./lib': No such file or directory
rm: cannot remove `./reports': No such file or directory
rm: cannot remove `./src/local_config.py': No such file or directory
Make new env
/home/milez/Projects/GameServer-jenkins
[sudo] password for milez:
@guyromm
guyromm / gist:1069599
Created July 7, 2011 14:14
комрессирует скрипты на лету, плагин для routes, инвокация в конце.
def cscript_expand(kw,style=False):
if style: cachedir='styles'
else: cachedir='scripts'
#we need to hash our list of scripts to get a unique new compressed name for it
m = hashlib.md5()
last_mt = None
sz = 0
#remove logging in compressed scripts
if '/general_trawler.js' in kw['o']: kw['o'][kw['o'].index('/general_trawler.js')]='/general_trawler_nologging.js'
for scr in kw['o']: