Skip to content

Instantly share code, notes, and snippets.

View fliiiix's full-sized avatar
🎩
This is the year of ipv6 and python3!

Felix fliiiix

🎩
This is the year of ipv6 and python3!
View GitHub Profile
@fliiiix
fliiiix / .bashrc
Last active August 29, 2015 13:56
alias git_pull='echo "update repo" && git pull && echo "update submodule" && git submodule update --init --recursive && echo "kill ruby" && killall -u $user ruby'
alias bundler='bundle install --binstubs --path vendor'
alias gitsubmodulupdate='git submodule update --recursive && git submodule foreach git pull origin master && git commit -am "update submodul" && git push'
function mongologin(){
mongo admin --port $port -u mongoadmin -p $passwort
}
#!/usr/bin/env bash
# OpenSSL requires the port number.
SERVER=s.ytimg.com:443
DELAY=1
ciphers=$(openssl ciphers 'ALL:eNULL' | sed -e 's/:/ /g')
echo Obtaining cipher list from $(openssl version).
for cipher in ${ciphers[@]}
#!/usr/bin/env bash
#please check the paths for your app
BASE_FOLDER=/home/www/TestProject
PUMA_CONFIG_FILE=$BASE_FOLDER/config/puma.rb
#chante to your project folder
cd $BASE_FOLDER
require 'csv'
#static var
TIMESLICE = 20
FIBONACCI_RATIO_1_3 = 1.382.to_f
FIBONACCI_RATIO_1_6 = 1.6185.to_f
#schema: Date,Open,High,Low,Close,Volume,Adj Close
#read data
rawdata = File.read("data.csv")
# my solution
(1..100).each do |number|
out = ""
out = number.to_s if number % 3 != 0 && number % 5 != 0
out = "Fizz" if number % 3 == 0
out += "Buzz" if number % 5 == 0
puts out + "\n"
end
# better solution
<?php
header('Content-type: application/json');
$userid = "XXXXXXXXXXXX@N00";
$key = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx";
$items = 12;
$url = "http://api.flickr.com/services/rest/?&method=flickr.people.getPublicPhotos&api_key=" . $key . "&user_id=" . $userid . "&per_page=" . $items . "&format=json";

Keybase proof

I hereby claim:

  • I am fliiiix on github.
  • I am l33tname (https://keybase.io/l33tname) on keybase.
  • I have a public key whose fingerprint is 1E1C 3468 B06E 2BE0 AD02 95E7 6CBE 81FC 8465 BDC5

To claim this, I am signing this object:

pkill smbd;pkill nmbd
/usr/local/libexec/smbd /etc/samba/smb.conf
/usr/local/libexec/nmbd /etc/samba/smb.conf
@fliiiix
fliiiix / fuuu.rb
Last active August 29, 2015 14:01
#version 1
get "/:name/?" do |name|
url = Url.first(:nice => name)
halt 404 if url == nil
if url.post_id != nil
@post = Post.find(url.post_id)
elsif url.respond_to?(:music_post_id)
@post = MusicPost.find(url.music_post_id)
elsif url.respond_to?(:video_post_id)
querystring = "*#{q.downcase}* AND author"
respons = client.search index: 'thebookdb', body: { query:
{ query_string:
{ query: querystring, fuzziness: 2 },
}
}