This file contains 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
# syntax=docker/dockerfile:1 | |
FROM golang:1.20 AS build-stage | |
WORKDIR /app | |
COPY go.mod go.sum ./ | |
RUN go mod download | |
COPY . . |
This file contains 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
pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U |
This file contains 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
git rm -r --cached . | |
git add . | |
git commit -m "fixed untracked files" |
This file contains 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
def is_prime(num) | |
(2..(num ** 0.5).to_i).each { |n| return false if num % n == 0 } | |
true | |
end | |
number_of_primes = 0 | |
(2..1000000).each { |n| number_of_primes += 1 if is_prime n } | |
puts number_of_primes |
This file contains 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 | |
aria2c -j1 -i list -c --save-session output.log | |
has_error=`wc -l < output.log` | |
while [ $has_error -gt 0 ] | |
do | |
echo "still has $has_error errors, rerun aria2 to download ..." | |
aria2c -j1 -i list -c --save-session output.log | |
has_error=`wc -l < output.log` | |
sleep 10 |
This file contains 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
db.getCollection('bss_robot_reports').find({"ActionName": "Calling Shahkar Web Service Result", "OrderId": {$in : [380930,300254,205874]} }).sort({ReportDate: -1}) |
This file contains 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 getParameterByName(name, url) { | |
if (!url) url = window.location.href; | |
name = name.replace(/[\[\]]/g, "\\$&"); | |
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), | |
results = regex.exec(url); | |
if (!results) return null; | |
if (!results[2]) return ''; | |
return decodeURIComponent(results[2].replace(/\+/g, " ")); | |
} |
This file contains 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
public override void Up() | |
{ | |
var actions = new Dictionary<string, string>() { | |
{ "ActionName", "توضیح" } | |
}; | |
using (CRMEntities db = new CRMEntities()) | |
{ | |
foreach (var item in actions) | |
{ | |
var actionItem = db.Actions.FirstOrDefault(a => a.ActionName == item.Key); |
This file contains 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
grep -rnw '/path/to/somewhere/' -e "pattern" |
This file contains 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
ARGV.each do |arg| | |
text=File.open(arg).read | |
text.gsub!(/\r\n?/, "\n") | |
text.each_line do |line| | |
p = line.gsub("\n",'').split('_').collect(&:capitalize).join | |
puts "public string #{p} { get; set; } // #{line}" | |
end | |
end |
NewerOlder