Skip to content

Instantly share code, notes, and snippets.

@0x8BADFOOD
0x8BADFOOD / 0_reuse_code.js
Last active August 29, 2015 14:06
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
----- Esc -----
Quick change directory: Esc + c
Quick change directory history: Esc + c and then Esc + h
Quick change directory previous entry: Esc + c and then Esc + p
Command line history: Esc + h
Command line previous command: Esc + p
View change: Esc + t (each time you do this shortcut a new directory view will appear)
Print current working directory in command line: Esc + a
Switch between background command line and MC: Ctrl + o
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name
@0x8BADFOOD
0x8BADFOOD / gist:2e8fbeb16c397ac695eb
Created February 3, 2015 02:22
craigslist nice view ad
1BD/1BR condo for rent (Sunnyvale)
<b>Description</b> <ul> Nice pretty quiet place for living </ul>
<b>Unit Features</b> <ul> <li>Washer/Dryer</li> <li>Dishwasher</li> <li>AC/Heater</li> <li>Pretty big balcony</li> <li>1 parking space</li> <li>Tennis court and swimming pool access</li> <li>Water and Garbage costs are included </li> </ul>
<b>Leasing terms</b> <ul> <li>1 yr. lease</li> <li>Security deposit: $2090</li> <li>Rent due before 4th of every month</li> <li>Utilities (PG&E, Cable etc.) are not included.</li> </ul>
<b>Description</b> <ul> Nice pretty quiet place for living </ul>
<b>Unit Features</b> <ul> <li>Washer/Dryer</li> <li>Dishwasher</li> <li>AC/Heater</li> <li>2 balconies (big & small)</li> <li>1 parking space</li> <li>Tennis court and swimming pool access</li> <li>Water and Garbage costs are included in rent</li> <li>Grocery shops: Costco, Sprouts, Safeway</li> </ul>
<b>Leasing terms</b> <ul> <li>1 yr. lease</li> <li>Security deposit: $2090</li> <li>Rent due before 4th of every month</li> <li>
wget -O output.txt --user=user_name --password pass url --no-proxy
@0x8BADFOOD
0x8BADFOOD / gist:f4e290bc7907baa740af
Created February 13, 2015 21:28
Download site [wget]
wget -r -p -U Mozilla https://ya.ru --user your_name --password you_pass
case R.id.buttonRun:
Log.e(LOG_TAG, "buttonRun");
if (myTaskList != null && myTaskList.size() > 0){
for(MyTask task : myTaskList) {
Log.e(LOG_TAG, "Stopping task: " + task.getTaskID());
task.cancel(true);
}
myTaskList.clear();
}
@0x8BADFOOD
0x8BADFOOD / gist:a5c32bae4f04db4e8b15
Created June 9, 2015 18:41
Who uses port on Mac OS?
sudo lsof -i :80
@0x8BADFOOD
0x8BADFOOD / copy google map url
Last active October 3, 2015 08:40
copy google map url
https://www.dropbox.com/s/s3edo0nhxoo0tq6/Screenshot%202015-10-03%2001.38.39.png?dl=0
Open Google Maps.
Make a map or get directions.
When you're ready to share, click the main menu .
Select Share or embed map. ...
[Optional] Check the box next to "Short URL" to create a shorter web page link.
Double-click the link to highlight it, then copy it by pressing CTRL+C (for PC) or ⌘+C (for Mac).
@0x8BADFOOD
0x8BADFOOD / gmail_actions_example.html
Created October 3, 2015 08:48
Python script to send HTML email from command line
<!--
This is a sample email taken from https://developers.google.com/gmail/schemas/apps-script-tutorial
and used to test the GMail actions support.
-->
<html>
<head>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "EmailMessage",
@0x8BADFOOD
0x8BADFOOD / untitled
Last active November 7, 2015 02:34
Inverting string in plain c
#include <stdio.h> //for printf
#include <stdlib.h> //for malloc,free
#include <string.h> //for strlen
/*
Sapmple for inverting sting in plain c
Compile and run:
>gcc test.c -o test.bin && ./test.bin
*/