Skip to content

Instantly share code, notes, and snippets.

@eramdam
eramdam / eramdam.zsh-theme
Last active August 29, 2015 14:00
This oh-my-zsh theme is a modification of the dpoggi one bundled with oh-my-zsh, it features a non-emoji lightning character and some visual tweaks
# This theme is a modification of the dpoggi one bundled with oh-my-zsh, it features a non-emoji lightning character and some visual tweaks
function my_git_prompt_info() {
if [[ "$(git config --get oh-my-zsh.hide-status)" != "1" ]]; then
ref=$(command git symbolic-ref HEAD 2> /dev/null) || \
ref=$(command git rev-parse --short HEAD 2> /dev/null) || return
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$(git_remote_status)$ZSH_THEME_GIT_PROMPT_SUFFIX"
fi
}
if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi
@eramdam
eramdam / Bash-to-execute
Created June 19, 2014 16:03
iTunes 2 Youtube for Alfred
currentTune=`osascript itunes.scpt`
currentTune="$(perl -MURI::Escape -e 'print uri_escape($ARGV[0]);' "$currentTune")"
open "http://www.youtube.com/results?search_query=${currentTune}"
@eramdam
eramdam / Nintendo-survey.md
Created June 28, 2014 09:08
Because filling Nintendo surveys for games and consoles is boring, I made some commands to do it quickly.

How to fill the Nintendo surveys quickly

Or 'How to don't loose time on these damn surveys and earn your stars and start playing the game you just got

Since the Nintendo's website uses jQuery, we should totally use it to do that.

How ?

Open your JavaScript console (Cmd+Alt+J on Chrome OSX/Ctrl+Shift+J on Chrome Windows) and type the following commands :

@eramdam
eramdam / lastfm.js
Created June 28, 2014 11:14
A little nodeJS script (clipboard works only on OSX) to fetch tags about an artist from Last.FM quickly
var request = require('request')
var clipboard = require('child_process').spawn('pbcopy')
var colors = require('colors')
var log = console.log
function getTags(artistName) {
request('http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&artist='+artistName+'&api_key=21c55ae94ac46850ab59171f7da02c1d&format=json', function(err, res, body) {
if(!err && res.statusCode == 200) {
var json = JSON.parse(body)
#!/bin/bash
## A little script that does REAL random wallpaper changing. Because the OSX's one sucks.
force=false;
while getopts ":f" opt; do
case $opt in
f)
force=true;
;;

Keybase proof

I hereby claim:

  • I am Eramdam on github.
  • I am eramdam (https://keybase.io/eramdam) on keybase.
  • I have a public key whose fingerprint is D428 64DC E1DA 8CA1 CA5D 91C8 BDE8 E9B2 FF55 71BB

To claim this, I am signing this object:

@eramdam
eramdam / 01-browser.js
Last active April 8, 2024 06:00
Downloading FB stickers
// Open facebook.com/messages and the stickers pop-up, click on a Facebook Sticker set, open up your JS console and paste this
function dumpStickers() {
URLs = [];
URLs.push(document.querySelectorAll('._5r8a._5r8b')[0].getAttribute('aria-label'));
[].slice.call(document.querySelectorAll('._5r8h')).forEach(function (el) {
URLs.push(el.querySelector('div').style.backgroundImage.replace('url(','').replace(')','').replace('p64','p128').replace('x64','x128'));
});
return URLs;
}
copy(dumpStickers());
command: (callback) => {
const apple = require('./lib/applescript.js');
console.log(apple);
callback(null, 'apple');
},
render: () => `
<div id="player">
<header>
<span class="title"></span>
@eramdam
eramdam / README.md
Last active December 30, 2016 05:15
Scrambled Eggs: hide "eggs" accounts from notifications

Disclaimer

This is just a proof of concept, nowhere complete. I will probably implement this as its own Chrome extension and/or add it to Better TweetDeck.

What's this?

It's a simple userscript that simply hides tweets, likes and retweets from "eggs" accounts on Twitter Web in your Notifications page. That's it. Install it and enjoy.

As said in the disclaimer, it's just a proof of concept. If proven actually useful/efficient it could be turned into a browser extension but will most likely be integrated into Better TweetDeck first.

Twitter ~ GitHub

@eramdam
eramdam / background-color-iterm2.jpg
Last active August 20, 2018 22:59
Get A Nice iTerm2/zsh Config With These Easy Tricks! (random emoji goodness)
background-color-iterm2.jpg