Skip to content

Instantly share code, notes, and snippets.

View telamon's full-sized avatar
🥲
probing for lost signals

Tony Ivanov telamon

🥲
probing for lost signals
View GitHub Profile
@samueljseay
samueljseay / es6-import-cheat-sheet.md
Created June 2, 2017 02:35
ES6 exports / imports cheat sheet
// default exports
export default 42;
export default {};
export default [];
export default (1 + 2);
export default foo;
export default function () {}
export default class {}
export default function foo () {}
#
function clearDockerContainerLog() {
_dirname=$(sudo ls /var/lib/docker/containers/ | grep $1)
sudo sh -c "cat /dev/null > /var/lib/docker/containers/$_dirname/$_dirname-json.log"
_dirname=""
}
alias clean-docker-log="clearDockerContainerLog"
// Needed in AndroidManifest:
<!-- Permission for using NFC hardware -->
<uses-permission android:name="android.permission.NFC"/>
<!-- Forcing device to have NFC hardware -->
<uses-feature android:name="android.hardware.nfc" android:required="true"/>
<!-- Registering app for receiving NFC's TAG_DISCOVERED intent -->
<intent-filter>
<action android:name="android.nfc.action.TAG_DISCOVERED"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
@magnetikonline
magnetikonline / README.md
Last active September 1, 2023 00:41
Bookmarklet to pretty print Gist pages without the usual page chrome, just content.

Pretty print bookmarklet helper for Gist pages

Create a new bookmark somewhere handy in your browser with the following URL:

javascript:var el=document.createElement('style');el.media='print';el.innerHTML='#header,.pagehead.repohead,.gist-description.container,.file-box .meta,#comments,.js-comment-form,#footer{display:none;}.file-box{border:0!important;}';document.getElementsByTagName('head')[0].appendChild(el);alert('Please consider the environment before printing :)');
  • Navigate to your Gist of choice
  • Hit the bookmarklet
@shokai
shokai / wifi_gmap_location.rb
Created August 2, 2012 22:15
Get your location with WiFi BSSID and GoogleMap
#!/usr/bin/env ruby
require 'net/http'
require 'uri'
require 'json'
def get_addrs
case RUBY_PLATFORM
when /darwin/
lines = `/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -s`.split(/[\r\n]/)
lines.shift