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
gh repo list {org_name} --language Go --limit 500 | grep -v ct- | awk '{print $1}' | xargs -I '$' git clone '[email protected]:$.git' |
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 ( | |
"bytes" | |
"crypto/rand" | |
"crypto/rsa" | |
"crypto/x509" | |
"encoding/base64" | |
"encoding/pem" | |
"errors" |
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 ( | |
"bytes" | |
"crypto/aes" | |
"crypto/cipher" | |
"encoding/base64" | |
"fmt" | |
) |
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
# lib/tasks/db.rake | |
namespace :db do | |
desc "Dumps the database to db/APP_NAME.dump" | |
task :dump => :environment do | |
cmd = nil | |
with_config do |app, host, db, user| | |
cmd = "pg_dump -h #{host} -U #{user} --verbose --clean --no-owner --no-acl --format=c #{db} > #{Rails.root}/db/#{app}.dump" | |
end | |
puts cmd |
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
<?php | |
$urls = array("http://webcontest.mirlab.org", "http://webprogramming.mirlab.org"); | |
for ($i=0; $i<count($urls); $i++) | |
{ | |
getContent($urls[$i]); | |
} | |
function getContent($url) | |
{ |
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
require 'fileutils' | |
require 'date' | |
require 'yaml' | |
require 'rexml/document' | |
require 'ya2yaml' | |
require 'uri' | |
include REXML | |
doc = Document.new(File.new(ARGV[0])) |
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
require 'digest/md5' | |
num = 36 # total number we want to create | |
user_info = File.new('user_info.txt', 'w+') | |
config_content = File.new('config_content.txt', 'w+') | |
(1..num).each do |t_num| | |
team_name = "team#{t_num}" | |
passwd = (0...6).map{97.+(rand(25)).chr}.join # random a string for password | |
user_info.write("#{team_name}\t#{passwd}\n") | |
passwd = Digest::MD5.hexdigest(passwd) # encoding string to md5 format |