This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "crypto/md5" | |
| "crypto/sha1" | |
| "encoding/hex" | |
| "fmt" | |
| "io" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func Shift(list []string) (string, []string) { | |
| return list[0], list[1:len(list)] | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function childFind(selector, which) { | |
| if (!this || !this.length) return $([]); | |
| which = (which || 'previous') + 'Sibling'; | |
| var element = this[0][which]; | |
| while (element && (element.nodeType !== 1 || !$(element).is(selector))) element = element[which]; | |
| return $(element); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /bin/bash | |
| # GITLAB | |
| # Maintainer: @randx | |
| # App Version: 2.9 | |
| # from: https://raw.github.com/gitlabhq/gitlab-recipes/master/init.d/gitlab | |
| ### BEGIN INIT INFO | |
| # Provides: gitlab | |
| # Required-Start: $local_fs $remote_fs $network $syslog redis-server |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sed -e 's/^rvm \(.*\)/\1/' .rvmrc | grep '@' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # separating emails by the host | |
| hash = {} | |
| %w{ [email protected] [email protected] }.each do |mail| | |
| id, host = mail.split("@") | |
| hash[host] ||= [] | |
| hash[host] << id | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| >> Resolv::DNS.new.getresources("gmail.com", Resolv::DNS::Resource::IN::MX).map { |dns| dns.exchange.to_s } | |
| => ["alt3.gmail-smtp-in.l.google.com", "alt4.gmail-smtp-in.l.google.com", "gmail-smtp-in.l.google.com", "alt1.gmail-smtp-in.l.google.com", "alt2.gmail-smtp-in.l.google.com"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var i = 6, | |
| list = {}; | |
| console.log('base: 16px'); | |
| console.log('-----------------'); | |
| while (i < 50) { | |
| var px = i + 'px', | |
| em = String(i/16) + 'em'; | |
| list[px] = em; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var ben = require('ben'); | |
| var fn = ben(100000, function() { | |
| var test = function() { return "test"; }; | |
| test(); | |
| }); | |
| var newFunction = ben(100000, function() { | |
| var test = new Function('', 'return "test"'); | |
| test(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| osascript << EOT | |
| tell application "System Events" | |
| sleep | |
| end | |
| EOT |