Skip to content

Instantly share code, notes, and snippets.

View comigor's full-sized avatar
:shipit:
Shippin'

Igor Borges comigor

:shipit:
Shippin'
View GitHub Profile
@brianhanifin
brianhanifin / LetMeGoogleThatForYou.js
Created February 24, 2009 02:17 — forked from bollwyvl/LetMeGoogleThatForYou.js
Let Me Google That For You (LMGTFY)
CmdUtils.CreateCommand({
name: "lmgtfy",
synonyms: ["letmegooglethatforyou"],
takes: {"words to google": noun_arb_text},
icon: "http://letmegooglethatforyou.com/favicon.ico",
description: "Replaces the selected words with a <a href=\"http://www.tinyurl.com\">TinyUrl</a> of the <a href=\"\">Let Me Google That For You</a> link",
preview: function( pblock, urlToShorten ){
pblock.innerHTML = "Replaces the selected URL with a tiny LMGTFY url.";
var baseUrl = "http://tinyurl.com/api-create.php?url=http://letmegooglethatforyou.com/?q=";
pblock.innerHTML = "Replaces the selected URL with ",
@jhickner
jhickner / clojurescript
Created April 11, 2012 22:05
underscore.js -> clojurescript
(defn debounce [func wait immediate]
(let [timeout (atom nil)]
(fn []
(this-as this
(let [context this
args js/arguments
later (fn []
(reset! timeout nil)
(when-not immediate
(.apply func context args)))]
@4ndrej
4ndrej / SSLPoke.java
Last active January 3, 2024 09:50
Test of java SSL / keystore / cert setup. Check the comment #1 for howto.
import javax.net.ssl.SSLParameters;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import java.io.*;
/** Establish a SSL connection to a host and port, writes a byte and
* prints the response. See
* http://confluence.atlassian.com/display/JIRA/Connecting+to+SSL+services
*/
public class SSLPoke {
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active June 5, 2024 22:16
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@stbuehler
stbuehler / bma2otp.rb
Created January 25, 2014 14:10
Decode the Battle.net Mobile Authenticator (android) secret data into an otpauth url. Requires a way to access the private data of the application (i.e. a rooted android).
#!/usr/bin/ruby
# REQUIRES:
# * rooted android, as otherwise you can't read the applications private data
# * to display the qr code "qrencode" (http://fukuchi.org/works/qrencode/)
# and "display" from ImageMagick
# This script "decrypts" the token from the internal state of the
# Battle.net Mobile Authenticator on android application, converting
# it into an "otpauth" url (https://code.google.com/p/google-authenticator/wiki/KeyUriFormat)
@maio
maio / deaccent.clj
Created December 26, 2014 13:06
Remove accent from string using Clojure
(defn deaccent [str]
"Remove accent from string"
;; http://www.matt-reid.co.uk/blog_post.php?id=69
(let [normalized (java.text.Normalizer/normalize str java.text.Normalizer$Form/NFD)]
(clojure.string/replace normalized #"\p{InCombiningDiacriticalMarks}+" "")))
@DraTeots
DraTeots / ComPort over Network.md
Last active June 25, 2024 05:02
ComPort over Network
@Sunno
Sunno / AndroidManifest.xml
Created September 2, 2015 19:08
Set a custom contact item in android address book
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.my_app" >
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.READ_PROFILE" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<!-- for syncing -->
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
@jgamblin
jgamblin / crashsafari.html
Created January 26, 2016 00:07
crashsafari
<!DOCTYPE html>
<html>
<body>
<h1>Crash Safari</h1>
<script>
var total = "";
for( var i = 0; i < 100000; i++ ) {
total = total + i.toString();
history.pushState(0,0, total );
}
@craigbeck
craigbeck / introspection-query.graphql
Created April 6, 2016 20:20
Introspection query for GraphQL
query IntrospectionQuery {
__schema {
queryType { name }
mutationType { name }
subscriptionType { name }
types {
...FullType
}
directives {