Skip to content

Instantly share code, notes, and snippets.

kecebongsoft kecebongsoft

Block or report user

Report or block kecebongsoft

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kecebongsoft
kecebongsoft / gist:11312110
Created Apr 26, 2014
Bulk remove iTerm2 color schemes.
View gist:11312110
# There was a day where I have too many color schemes in iTerm2 and I want to remove them all.
# iTerm2 doesn't have "bulk remove" and it was literally painful to delete them one-by-one.
# iTerm2 save it's preference in ~/Library/Preferences/com.googlecode.iterm2.plist in a binary format
# What you need to do is basically copy that somewhere, convert to xml and remove color schemes in the xml files.
$ cd /tmp/
$ cp ~/Library/Preferences/com.googlecode.iterm2.plist .
$ plutil -convert xml1 com.googlecode.iterm2.plist
$ vi com.googlecode.iterm2.plist
@kecebongsoft
kecebongsoft / 10fastfinger_bot.js
Created Dec 22, 2011
BOT for 10fastfingers, automatic typing with adjustable speed
View 10fastfinger_bot.js
/*
* BOT for 10fastfingers, automatic typing with adjustable speed
* ================================================================
*
* bored in my apartment and decided to hack this game: http://indonesian-speedtest.10fastfingers.com/
* just start the game, when you're ready to type, DON'T TYPE ANYTHING, open up
* your Developer Tools in Chrome (CTRL+SHIFT+J) and click Console tab, and
* then paste the whole code below, then press enter, and enjoy the show.
*
* twitter.com/kecebongsoft
View django-haystack & SOLR randomise ordering
"""It's a hack for solr backend to apply django-style random ordering
with '?'. Change haystack/backends/solr_backend.py
"""
# .. Somewhere in the beginning
import random
# .. Somewhere in :638, replace content of for-loop into these:
if order_by.startswith('-'):
order_by_list.append('%s desc' % order_by[1:])
elif order_by.startswith('?'):
View dinnerline.py
from itertools import permutations
print '\n'.join(['%s?' % ' '.join(s) for s in permutations("kamu mau makan malam apa".split())])
"""
>>>
kamu mau makan malam apa?
kamu mau makan apa malam?
kamu mau malam makan apa?
kamu mau malam apa makan?
kamu mau apa makan malam?
View gist:6634511
<div id='mobile'>{% load inquiry_inline %}
<div style='text-align:center' align='center'>
<img src='https://dk0kblssebjoq.cloudfront.net/media/picture/2013/09/17/logo.png'>
<div class='banner1-heading lightblue2'>KEUNGGULAN NILAI UNIVERSITY</div>
<ul class='checkmarklist'>
<li><span>&nbsp;</span>Universitas dengan peringkat 5 (Excellent) <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;oleh badan SETARA, Malaysia.</li>
<li><span>&nbsp;</span>Kolaborasi dengan Universitas International</li>
<li><span>&nbsp;</span>Fasilitas dengan standard International</li>
<li><span>&nbsp;</span>Suasana Global dengan mahasisawa internasional <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;yang berasal dari lebih 50 negara</li>
</ul>
View mapping
aisah,leadershipresources_aisah
alpa,leadershipresources_alpa
ana,leadershipresources_ana
anand,leadershipresources_anand
annie,leadershipresources_annie
asnija,leadershipresources_asnija
babu,leadershipresources_babu
bounces,leadershipresources_bounces
bugh,leadershipresources_bugh
chong,leadershipresources_chong
View vbshout
<form action="vbshout.php.?{$session['sessionurl']}" method="post" name="vbshoutform" onsubmit="return postShout(this)">
<input type='hidden' name='do' value='shout' />
<input type='hidden' name='color' />
<input type='hidden' name='fontFamily' />
<input type='hidden' name='fontWeight' />
<input type='hidden' name='textDecoration' />
<input type='hidden' name='fontStyle' />
<div id='shout_emo' style='display:none'>
@kecebongsoft
kecebongsoft / ga_aggregate_report
Created Jan 10, 2013
Aggregates number of page views from individual URLS based on arguments in GA. Uses CSV.
View ga_aggregate_report
import operator
import csv
import sys
import re
source = sys.argv[1]
output = sys.argv[2]
column = sys.argv[3]
reader = csv.reader(open(source, 'rb'), delimiter=',', quotechar='"')
@kecebongsoft
kecebongsoft / gist:3051434
Created Jul 5, 2012
Bash: Copy files with list of excluded files.
View gist:3051434
Say you need to copy files in a folder to somewhere else, except that you have a list of files that might be exist in the source folder but you don't want them to be copied. Your text file that has this list is named list.txt:
------------------------
exclude1.mp3
dont_copy.mpeg
nyancat.jpg
------------------------
$ cd source/
$ cat /path/to/list.txt | tr '\n' '#' | sed 's/.$//g' | sed 's/#/\\\\|/g' | xargs -i sh -c "ls | grep -v '{}'" | xargs -i cp -v -u {} /path/to/dest/
You can’t perform that action at this time.